]> ruin.nu Git - icfp05.git/blobdiff - botsrc/bot.h
release
[icfp05.git] / botsrc / bot.h
index 731a106a4a1dbcc847ee41f2fd65da03c1ac96dd..2645ac0a8226d9bd8e8001abb5c0356929f28df6 100644 (file)
@@ -65,9 +65,10 @@ struct SPInfo{
 };
 
 
-struct SPGoal{
-       virtual ~SPGoal(){}
-       virtual int operator()(const SPInfo* node) const = 0;
+class SPGoal{
+       public:
+               virtual ~SPGoal(){}
+               virtual int operator()(const SPInfo* node) const = 0;
 };
 
 class Bot {
@@ -81,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<std::string> shortestPath(const std::string& from, PlayerType type, const SPGoal& goal, bool reverse = false);
@@ -99,16 +101,18 @@ class Bot {
        int _smell;
 };
 
-struct SimpleSPGoal : public SPGoal{
+class SimpleSPGoal : public SPGoal{
        std::string _to;
+       public:
        SimpleSPGoal(std::string to);
        int operator()(const SPInfo* node) const;
 };
 
-struct FindPlayer : SPGoal{
+class FindPlayer : public SPGoal{
        int _limit;
        const __gnu_cxx::hash_map<std::string, Player>& _players;
        PlayerType _type;
+       public:
        FindPlayer(const __gnu_cxx::hash_map<std::string, Player>& players, PlayerType type, int limit = 0);
        int operator()(const SPInfo* node) const;
 };