#define __BOT_H__
#include <ext/hash_map>
-#include <vector>
+#include <list>
#include <string>
#include <locale>
+#include <map>
// 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 >
};
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<std::string,StreetType> connections;
};
struct Player{
- std::string type;
+ PlayerType type;
std::string location;
};
class Bot {
public:
- Bot(std::string name, std::string type);
+ Bot(const std::string& name, PlayerType type);
virtual ~Bot();
virtual void play();
void updateWorld();
virtual std::string turn();
void move(std::string location);
- std::vector<std::string> shortestPath(std::string from, std::string to, std::string type);
+ std::list<std::string> shortestPath(const std::string& from, const std::string& to, PlayerType type);
__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::map<PlayerType, std::string> _playerTypeNames;
+ std::map<std::string, PlayerType> _playerTypes;
std::string _name;
- std::string _type;
+ PlayerType _type;
std::string _location;
int _world;
int _robbed;