RTS2D
|
00001 #ifndef PROJECTILEPROPERTY_H 00002 #include <cstdio> 00003 #include <map> 00004 #include "allegro5/allegro.h" 00005 #define PROJECTILEPROPERTY_H 00006 00007 enum PROJECTILE_TYPE {MELEE, ARROW, p_count}; 00011 class ProjectileProperty { 00012 public: 00013 static ProjectileProperty* getInstance() { 00014 if(instance == NULL) { 00015 instance = new ProjectileProperty(); 00016 } 00017 return instance; 00018 } 00019 virtual ~ProjectileProperty(); 00020 00021 void loadSpeed(); 00022 void loadRadius(); 00023 void loadBitmap(); 00024 00025 float getSpeed(int type); 00026 float getRadius(int type); 00027 ALLEGRO_BITMAP* getBitmap(int type); 00028 00029 protected: 00030 private: 00031 ProjectileProperty(); 00032 static ProjectileProperty* instance; 00033 std::map <int,float> speed_; 00034 std::map <int,float> radius_; 00035 std::map <int,ALLEGRO_BITMAP*> bitmap_; 00036 }; 00037 00038 #endif // PROJECTILEPROPERTY_H