X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=botsrc%2Fbot.h;h=84f9de58f4d149d0859d898f7338da5fedd555c6;hb=d9ea67edb4cdaab1f5f7810de640f8fb722a15d1;hp=ee236ee1e0519056ad9d70cb0aef978d0538775b;hpb=6dcb23cff9df56ada5c065398d08730ee02c9c5a;p=icfp05.git diff --git a/botsrc/bot.h b/botsrc/bot.h index ee236ee..84f9de5 100644 --- a/botsrc/bot.h +++ b/botsrc/bot.h @@ -67,8 +67,8 @@ struct SPInfo{ class SPGoal{ public: - virtual ~SPGoal(){} - virtual int operator()(const SPInfo* node) const = 0; + virtual ~SPGoal(){} + virtual int operator()(const SPInfo* node) const = 0; }; class Bot { @@ -81,33 +81,43 @@ class Bot { protected: void buildGraph(); void updateWorld(); - virtual std::string turn() = 0; - void move(std::string location); + virtual std::string turn(); + virtual void preGamePreparations(){}; + virtual void move(std::string location); + virtual void sendInformation(); + virtual void getInformation(); + virtual void sendPlan(); + virtual void getPlans(); + virtual void vote(); + virtual void voteResult(); void getPlayers(); std::list shortestPath(const std::string& from, PlayerType type, const SPGoal& goal, bool reverse = false); - __gnu_cxx::hash_map _intersections; - __gnu_cxx::hash_map _players; - __gnu_cxx::hash_map _banks; - std::map _evidence; - std::map _playerTypeNames; - std::map _playerTypes; - std::string _name; - PlayerType _type; - std::string _location; - int _world; - int _robbed; - int _smell; + __gnu_cxx::hash_map _intersections; + __gnu_cxx::hash_map _players; + __gnu_cxx::hash_map _banks; + std::map _evidence; + std::map _playerTypeNames; + std::map _playerTypes; + std::string _name; + PlayerType _type; + std::string _location; + int _world; + int _robbed; + int _smell; + std::string _robberLocation; + std::string _copHq; + __gnu_cxx::hash_map _winningPlans; }; class SimpleSPGoal : public SPGoal{ std::string _to; - SimpleSPGoal(std::string to); public: + SimpleSPGoal(std::string to); int operator()(const SPInfo* node) const; }; -class FindPlayer : SPGoal{ +class FindPlayer : public SPGoal{ int _limit; const __gnu_cxx::hash_map& _players; PlayerType _type;