X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=bot%2Fbot.h;h=7d278319332a6c9e2c416d9fa3d3f6aef5f34a41;hb=f42b544842d9b9f21da3898225a70dec23c57a36;hp=416fe63a000e9ee68f9f0998a2023266c6048f4c;hpb=1e91b29637d981acb253bc4be7d0eeab63602790;p=icfp05.git diff --git a/bot/bot.h b/bot/bot.h index 416fe63..7d27831 100644 --- a/bot/bot.h +++ b/bot/bot.h @@ -2,9 +2,10 @@ #define __BOT_H__ #include -#include +#include #include #include +#include // These are needed to be able to use std::string as key in a hash_map. namespace __gnu_cxx { template< typename CharT, typename Traits, typename Alloc > @@ -33,6 +34,8 @@ namespace __gnu_cxx { }; enum StreetType{foot, car, both}; +enum PlayerType{robber, cop_foot, cop_car}; +enum IntersectionType{hq, bank, robber_start, ordinary}; struct Intersection{ __gnu_cxx::hash_map connections; @@ -42,7 +45,7 @@ struct Intersection{ }; struct Player{ - std::string type; + PlayerType type; std::string location; }; @@ -56,7 +59,7 @@ T value(std::string input); class Bot { public: - Bot(std::string name, std::string type); + Bot(const std::string& name, PlayerType type); virtual ~Bot(); virtual void play(); @@ -66,12 +69,15 @@ class Bot { void updateWorld(); virtual std::string turn(); void move(std::string location); + std::list shortestPath(const std::string& from, const std::string& to, PlayerType type); __gnu_cxx::hash_map _intersections; __gnu_cxx::hash_map _players; __gnu_cxx::hash_map _banks; + std::map _playerTypeNames; + std::map _playerTypes; std::string _name; - std::string _type; + PlayerType _type; std::string _location; int _world; int _robbed;