]> ruin.nu Git - icfp05.git/blobdiff - bot/bot.h
some restructuring
[icfp05.git] / bot / bot.h
index 72d2d6bd7a88888bd3f9367dc3c783beac2c435b..731a106a4a1dbcc847ee41f2fd65da03c1ac96dd 100644 (file)
--- a/bot/bot.h
+++ b/bot/bot.h
@@ -101,13 +101,16 @@ class Bot {
 
 struct SimpleSPGoal : public SPGoal{
        std::string _to;
-       SimpleSPGoal(std::string to):_to(to){};
-       ~SimpleSPGoal(){}
-       int operator()(const SPInfo* node) const{
-               if (node->name == _to)
-                       return 1;
-               return 0;
-       }
+       SimpleSPGoal(std::string to);
+       int operator()(const SPInfo* node) const;
+};
+
+struct FindPlayer : SPGoal{
+       int _limit;
+       const __gnu_cxx::hash_map<std::string, Player>& _players;
+       PlayerType _type;
+       FindPlayer(const __gnu_cxx::hash_map<std::string, Player>& players, PlayerType type, int limit = 0);
+       int operator()(const SPInfo* node) const;
 };
 
 #endif