class SPGoal{
public:
- virtual ~SPGoal(){}
- virtual int operator()(const SPInfo* node) const = 0;
+ virtual ~SPGoal(){}
+ virtual int operator()(const SPInfo* node) const = 0;
};
class Bot {
class SimpleSPGoal : public SPGoal{
std::string _to;
- SimpleSPGoal(std::string to);
public:
+ SimpleSPGoal(std::string to);
int operator()(const SPInfo* node) const;
};
-class FindPlayer : SPGoal{
+class FindPlayer : public SPGoal{
int _limit;
const __gnu_cxx::hash_map<std::string, Player>& _players;
PlayerType _type;
bank != _banks.end(); ++bank){
//cerr << "Handling bank at: " << bank->first << endl;
if (bank->second > 0){
+ list<string> cop = shortestPath(bank->first, cop_car, FindPlayer(_players, cop_car, 3), true);
+ if (cop.size() > 0)
+ continue;
+ else{
+ cop = shortestPath(bank->first, cop_foot, FindPlayer(_players, cop_foot, 3), true);
+ if (cop.size() > 0)
+ continue;
+ }
list<string> l = shortestPath(street->first, _type, SimpleSPGoal(bank->first));
if (l.size() < 1)
continue;