]> ruin.nu Git - icfp05.git/blobdiff - botsrc/bot.cpp
added limit to SimpleSPGoal and ensured that two additional cops chases the smell
[icfp05.git] / botsrc / bot.cpp
index a98a42bfb8fc5978a41c7ddcd14ad2b1cd6e0489..411d933ee50d7bab0ab689b320a753d464cb3f06 100644 (file)
@@ -369,10 +369,12 @@ std::list<std::string> Bot::shortestPath(const std::string& from, PlayerType typ
        return list<string>();
 }
 
-SimpleSPGoal::SimpleSPGoal(std::string to):_to(to){
+SimpleSPGoal::SimpleSPGoal(const std::string& to, int limit):_to(to), _limit(limit){
 }
 
 int SimpleSPGoal::operator()(const SPInfo* node) const{
+       if (_limit > 0 && node->cost >= _limit)
+               return -1;
        if (node->name == _to)
                return 1;
        return 0;