private void verifyInvariants(bool displayIfOK)
{
string errors = "";
if (currentState != State.NO_EDITS)
{
if (currentState == State.EDITING_WORLD && world.player == null)
{
errors += "There is no player in the world! The game will not run without a player. \n\n";
}
//Check for badly linked doors.
errors += verifyDoors();
//Display the errors if they exist
if (errors != "")
{
showMessage("Invariants broken!", errors);
}
else if (displayIfOK)
{
showMessage("No broken invariants!", "No broken invariants!");
}
}
}