]> ruin.nu Git - icfp05.git/blobdiff - bot/bot.h
implemented shortest path
[icfp05.git] / bot / bot.h
index d07fb06e829dbb395105873333f75cb86023f58e..483cfd5f6418e4850e91312319cd2d034c05e816 100644 (file)
--- a/bot/bot.h
+++ b/bot/bot.h
@@ -32,12 +32,13 @@ namespace __gnu_cxx {
                };
 };
 
-struct AdjInfo{
-       std::string intersection;
-};
+enum StreetType{foot, car, both};
 
 struct Intersection{
-       std::vector<AdjInfo> adjs;
+       __gnu_cxx::hash_map<std::string,StreetType> connections;
+       std::string type;
+       int x;
+       int y;
 };
 
 struct Player{
@@ -50,23 +51,32 @@ struct Bank{
        int value;
 };
 
-std::vector<std::string> tokenizeString(std::string input);
+template<class T>
+T value(std::string input);
 
 class Bot {
        public:
                Bot(std::string name, std::string type);
+               virtual ~Bot();
+
+               virtual void play();
 
-               void play();
+       protected:
                void buildGraph();
                void updateWorld();
-               virtual void turn() = 0;
+               virtual std::string turn();
+               void move(std::string location);
+               std::vector<std::string> shortestPath(std::string from, std::string to, std::string type);
 
-       private:
        __gnu_cxx::hash_map<std::string, Intersection> _intersections;
        __gnu_cxx::hash_map<std::string, Player> _players;
+       __gnu_cxx::hash_map<std::string, int> _banks;
        std::string _name;
        std::string _type;
-       std::string _position;
+       std::string _location;
+       int _world;
+       int _robbed;
+       int _smell;
 };