_name = value<string>(input);
cerr << "Got name: " << _name << endl;
- //robber and 5 cops
- getline(cin, input);
- _players[value<string>(input)].type = robber;
- getline(cin, input);
- _players[value<string>(input)].type = cop_foot;
- getline(cin, input);
- _players[value<string>(input)].type = cop_foot;
- getline(cin, input);
- _players[value<string>(input)].type = cop_foot;
- getline(cin, input);
- _players[value<string>(input)].type = cop_foot;
+ getPlayers();
cerr << "Got players, building graph." << endl;
getline(cin, input);
buildGraph();
- getline(cin, input);
while (true){
getline(cin, input);
updateWorld();
_type = _players[_name].type;
_location = _players[_name].location;
- getline(cin, input);
cerr << "New turn" << endl;
move(turn());
cerr << "Done with turn." << endl;
}
}
+void Bot::getPlayers(){
+ string input;
+ //robber and 5 cops
+ getline(cin, input);
+ _players[value<string>(input)].type = robber;
+ getline(cin, input);
+ _players[value<string>(input)].type = cop_foot;
+ getline(cin, input);
+ _players[value<string>(input)].type = cop_foot;
+ getline(cin, input);
+ _players[value<string>(input)].type = cop_foot;
+ getline(cin, input);
+ _players[value<string>(input)].type = cop_foot;
+}
+
/**
nod\ eol
( nod: loc node-tag coordinate coordinate eol )*
_intersections[from].connections[to] = car;
}
cerr << "Number of streets: " << streets << endl;
+ getline(cin, input);
}
void Bot::updateWorld(){
pl.type = _playerTypes[input];
}
//cerr << "Number of players: " << _players.size() << endl;
+ getline(cin, input);
}
void Bot::move(std::string location){