RTS2D
include/property/UnitProperty.h
00001 #ifndef UNITPROPERTY_H
00002 #include <cstdio>
00003 #include <map>
00004 #include <vector>
00005 #include <string>
00006 #include "ProjectileProperty.h"
00007 #include "allegro5/allegro.h"
00008 #define UNITPROPERTY_H
00009 
00010 enum UNIT_TYPE {WORKER, WARRIOR, ARCHER, u_count};
00014 class UnitProperty {
00015 public:
00016     virtual ~UnitProperty();
00017     static UnitProperty* getInstance() {
00018         if (instance == NULL) {
00019             instance = new UnitProperty();
00020         }
00021         return instance;
00022     }
00023     void loadCost();
00024     void loadProjectile();
00025     void loadCount();
00026     void loadMaxHp();
00027     void loadDamage();
00028     void loadAttackSpeed();
00029     void loadRange();
00030     void loadAggroRadius();
00031     void loadSpeed();
00032     void loadRadius();
00033     void loadTime();
00034     void loadName();
00035     void loadAction();
00036     void loadBitmap();
00037     void loadIcon();
00038 
00039     int getCost(int type);
00040     int getProjectile(int type);
00041     int getCount(int type);
00042     float getMaxHp(int type);
00043     float getDamage(int type);
00044     float getAttackSpeed(int type);
00045     float getRange(int type);
00046     float getAggroRadius(int type);
00047     float getSpeed(int type);
00048     float getRadius(int type);
00049     float getTime(int type);
00050     std::string getName(int type);
00051     std::vector<std::string> getAction(int type);
00052     std::vector<ALLEGRO_BITMAP*> getBitmap(int type);
00053     ALLEGRO_BITMAP* getIcon(int type);
00054 
00055     int getType(std::string name);
00056     int fps; // nao deveria estar aqui
00057 
00058 protected:
00059 private:
00060     UnitProperty();
00061     static UnitProperty* instance;
00062     std::map <int,int> cost_;
00063     std::map <int,int> projectile_;
00064     std::map <int,int> count_;
00065     std::map <int,float> maxhp_;
00066     std::map <int,float> damage_;
00067     std::map <int,float> speed_;
00068     std::map <int,float> attackspeed_;
00069     std::map <int,float> time_;
00070     std::map <int,float> radius_;
00071     std::map <int,float> aggroradius_;
00072     std::map <int,float> range_;
00073     std::map <int,std::string> name_;
00074     std::map <int,std::vector<std::string>> action_;
00075     std::map <int,std::vector<ALLEGRO_BITMAP*>> bitmap_;
00076     std::map <int,ALLEGRO_BITMAP*> icon_;
00077 
00078 };
00079 
00080 #endif //UNITPROPERTY_H
 Todos Classes Funções