- def change_mode(self, new_mode):
- """Advance to the next mode"""
- if new_mode == self.player_mode:
- raise RuntimeError("Inconsistent state. Setting mode %s to itself"
- % self.player_mode)
- elif new_mode in (ACT, EXAMINE):
- self.player_mode = new_mode
- if new_mode is EXAMINE:
- self.board_update()
- else:
- raise RuntimeError("Illegal player mode %s" % self.player_mode)
-