BWAPI
|
00001 #pragma once 00002 #include <BWAPI/EventType.h> 00003 #include <BWAPI/Player.h> 00004 #include <BWAPI/Unit.h> 00005 #include <BWAPI/Position.h> 00006 #include <string> 00007 00008 namespace BWAPI 00009 { 00010 class Event 00011 { 00012 public: 00013 Event(); 00014 ~Event(); 00015 Event(const Event& other); 00016 Event& operator=(const Event& other); 00017 bool operator==(const Event& other) const; 00018 static Event MatchStart(); 00019 static Event MatchEnd(bool isWinner); 00020 static Event MatchFrame(); 00021 static Event MenuFrame(); 00022 static Event SendText(const char* text = NULL); 00023 static Event ReceiveText(Player* player, const char* text = NULL); 00024 static Event PlayerLeft(Player* player); 00025 static Event PlayerDropped(Player* player); 00026 static Event NukeDetect(Position target); 00027 static Event UnitDiscover(Unit* unit); 00028 static Event UnitEvade(Unit* unit); 00029 static Event UnitShow(Unit* unit); 00030 static Event UnitHide(Unit* unit); 00031 static Event UnitCreate(Unit* unit); 00032 static Event UnitDestroy(Unit* unit); 00033 static Event UnitMorph(Unit* unit); 00034 static Event UnitRenegade(Unit* unit); 00035 static Event SaveGame(const char* gameName = NULL); 00036 static Event UnitComplete(Unit *unit); 00037 EventType::Enum getType() const; 00038 Position getPosition() const; 00039 const std::string& getText() const; 00040 Unit* getUnit() const; 00041 Player* getPlayer() const; 00042 bool isWinner() const; 00043 00044 Event& setType(EventType::Enum type); 00045 Event& setPosition(Position position); 00046 Event& setText(const char* text); 00047 Event& setUnit(Unit* unit); 00048 Event& setPlayer(Player* player); 00049 Event& setWinner(bool isWinner); 00050 //static Event TriggerAction(); 00051 private: 00052 EventType::Enum type; 00053 Position position; 00054 std::string* text; 00055 Unit* unit; 00056 Player* player; 00057 bool winner; 00058 }; 00059 }