4 #include <ext/hash_map>
8 // These are needed to be able to use std::string as key in a hash_map.
10 template< typename CharT, typename Traits, typename Alloc >
11 struct hash< std::basic_string<CharT, Traits, Alloc> > {
12 size_t operator()(const std::basic_string<CharT, Traits, Alloc>& s) const {
14 const std::collate<CharT>& c = std::use_facet< std::collate<CharT> >(std::locale());
16 return c.hash(s.c_str(), s.c_str() + s.size());
22 template< typename CharT, typename Traits, typename Alloc >
23 struct hash< const std::basic_string<CharT, Traits, Alloc> > { //yes you need this version aswell!
25 size_t operator()(const std::basic_string<CharT, Traits, Alloc>& s) const {
27 const std::collate<CharT>& c = std::use_facet< std::collate<CharT> >(std::locale());
29 return c.hash(s.c_str(), s.c_str() + s.size());
36 std::string intersection;
40 std::vector<AdjInfo> adjs;
53 std::vector<std::string> tokenizeString(std::string input);
57 Bot(std::string name, std::string type);
62 virtual void turn() = 0;
65 __gnu_cxx::hash_map<std::string, Intersection> _intersections;
66 __gnu_cxx::hash_map<std::string, Player> _players;
69 std::string _position;