RTS2D
include/property/CommandProperty.h
00001 #ifndef COMMANDPROPERTY_H
00002 #include <cstdio>
00003 #include <map>
00004 #include <vector>
00005 #include <string>
00006 #include "allegro5/allegro.h"
00007 #define COMMANDPROPERTY_H
00008 
00009 
00010 enum COMMAND_TYPE {MOVE,STOP,ATTACK,UNLOAD,RALLY,GATHER,c_count};
00014 class CommandProperty {
00015 public:
00016     static CommandProperty* getInstance() {
00017         if(instance == NULL) {
00018             instance = new CommandProperty();
00019         }
00020         return instance;
00021     }
00022     virtual ~CommandProperty();
00023     void loadIcon();
00024     void loadName();
00025     std::string getName(int type);
00026     ALLEGRO_BITMAP* getIcon(int type);
00027     int getType(std::string name);
00028 
00029 protected:
00030 private:
00031     CommandProperty();
00032     static CommandProperty* instance;
00033     std::map <int,std::string> name_;
00034     std::map <int,ALLEGRO_BITMAP*> icon_;
00035 };
00036 
00037 
00038 #endif // COMMANDPROPERTY_H
 Todos Classes Funções