RTS2D
include/object/Building.h
00001 #ifndef Building_H
00002 #include "Define.h"
00003 #include "Unit.h"
00004 #include "Entity.h"
00005 #include "UnitProperty.h"
00006 #include "BuildingProperty.h"
00007 #include <allegro5/allegro_primitives.h>
00008 #define Building_H
00009 
00013 class Building : public Entity {
00014 public:
00015     Building(int x, int y, int type, int team);
00016     virtual ~Building();
00017     void setReady();
00018     int getX();
00019     void setX(int x);
00020     int getY();
00021     void setY(int y);
00022     float getTrainingTime();
00023     void setTrainingTime(float trainingTime);
00024     float getBuildingTime();
00025     void setBuildingTime(float buildingTime);
00026     float getMiningTime();
00027     void setMiningTime(float miningTime);
00028     bool isConstructing();
00029     void setConstructing(bool constructing);
00030     std::vector<int> getQueue();
00031     void setQueue(std::vector<int> queue);
00032     std::vector<Unit*> getSlot();
00033     bool insertSlot(Unit* unit);
00034     bool releaseSlot();
00035 
00036     float getRadius();
00037     float getMaxHp();
00038     int getDimension();
00039     int getCost();
00040     std::vector<std::string> getAction();
00041     ALLEGRO_BITMAP* getBitmap();
00042     std::string getName();
00043     float getTime();
00044 
00045     int getMaxSlot();
00046     int getMaxQueue();
00047     int getMiningGain();
00048     float getMiningCooldown();
00049 
00050     bool isActive();
00051     bool isBuilding();
00052     bool insertQueue(int unitType);
00053     bool removeQueue(int pos);
00054     void construct();
00055     void update();
00056     void render();
00057 
00058 protected:
00059 private:
00060     int x_;
00061     int y_;
00062     float trainingTime_;
00063     float buildingTime_;
00064     float miningTime_;
00065     bool constructing_;
00066     std::vector<int> queue_;
00067     std::vector<Unit*> slot_;
00068 };
00069 
00070 #endif // Building_H
 Todos Classes Funções