if (query != MovementResult::OK)
return query;
+ /*
+ //Removed 3/01/12 NO_MOVE now not allowed, SURRENDER is undocumented and not necessary
if (buffer == "NO_MOVE")
{
buffer += " OK";
buffer += " OK";
return MovementResult::SURRENDER;
}
+ */
int x; int y; string direction="";
stringstream s(buffer);
case MovementResult::OK:
buffer += " OK";
break;
- case MovementResult::VICTORY:
- buffer += " FLAG";
+ case MovementResult::VICTORY_FLAG:
+ buffer += " VICTORY_FLAG";
+ break;
+ case MovementResult::VICTORY_ATTRITION:
+ buffer += " VICTORY_ATTRITION";
break;
case MovementResult::KILLS:
buffer += " KILLS ";
return moveResult;
}
+
+/**
+ * Fixes the name of the controller
+ * Should be called AFTER the constructor, since it modifies the name string, which might be used in the constructor
+ */
+void Controller::FixName()
+{
+ for (unsigned int ii=0; ii < name.size(); ++ii)
+ {
+ if (name[ii] == ' ')
+ {
+ name.erase(ii); //Just erase everything after the first whitespace
+ break;
+ }
+ }
+ //This is kind of hacky; I added it so that I could pass arguments to the AIs
+ //Because simulate.py doesn't like extra arguments showing up in the AI name at the end of the game (its fine until then)
+ //So I'll just remove them, after they have been passed! What could possibly go wrong?
+ // - Last entry in Sam Moore's diary, 2012
+}
+