]> ruin.nu Git - icfp05.git/blobdiff - robbersrc/robber.cpp
banks with guarding cops is BAD.. and public inheritance is more useful than private
[icfp05.git] / robbersrc / robber.cpp
index dbb287a4d760b5bb2dd231497778866318fb24a4..8baf84e23edca71a830f183f36631682dc5394cf 100644 (file)
@@ -41,6 +41,14 @@ string Robber::turn(){
                                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;