X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=botsrc%2Fbot.h;h=2645ac0a8226d9bd8e8001abb5c0356929f28df6;hb=0802d5a4a639a7601f9e9d8a4d13836171c26bd1;hp=ee236ee1e0519056ad9d70cb0aef978d0538775b;hpb=6dcb23cff9df56ada5c065398d08730ee02c9c5a;p=icfp05.git diff --git a/botsrc/bot.h b/botsrc/bot.h index ee236ee..2645ac0 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 { @@ -82,6 +82,7 @@ class Bot { void buildGraph(); void updateWorld(); virtual std::string turn() = 0; + virtual void preGamePreparations(){}; void move(std::string location); void getPlayers(); std::list shortestPath(const std::string& from, PlayerType type, const SPGoal& goal, bool reverse = false); @@ -102,12 +103,12 @@ class Bot { 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;