X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=bot%2Fbot.h;h=483cfd5f6418e4850e91312319cd2d034c05e816;hb=9363db6b1b8322c4f424ce44db173f251336066e;hp=d07fb06e829dbb395105873333f75cb86023f58e;hpb=8e53d666f72d37d80fabee7e493d2058a13a6dae;p=icfp05.git diff --git a/bot/bot.h b/bot/bot.h index d07fb06..483cfd5 100644 --- 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 adjs; + __gnu_cxx::hash_map connections; + std::string type; + int x; + int y; }; struct Player{ @@ -50,23 +51,32 @@ struct Bank{ int value; }; -std::vector tokenizeString(std::string input); +template +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 shortestPath(std::string from, std::string to, std::string type); - private: __gnu_cxx::hash_map _intersections; __gnu_cxx::hash_map _players; + __gnu_cxx::hash_map _banks; std::string _name; std::string _type; - std::string _position; + std::string _location; + int _world; + int _robbed; + int _smell; };