handle the yes/no prompt in the battle run loop

This commit is contained in:
Bryan Bishop
2013-11-11 21:54:06 -06:00
parent 993eaa3451
commit 9f72be1a0f

View File

@@ -143,6 +143,8 @@ class Battle(EmulatorController):
if self.is_player_turn():
# battle hook provides input to handle this situation
self.handle_turn()
elif self.is_switch_prompt():
self.handle_switch_prompt()
elif self.is_mandatory_switch():
# battle hook provides input to handle this situation too
self.handle_mandatory_switch()
@@ -160,6 +162,13 @@ class Battle(EmulatorController):
"""
raise NotImplementedError
def handle_switch_prompt(self):
"""
The trainer is switching pokemon. The game asks yes/no for whether or
not the player would like to switch.
"""
raise NotImplementedError
def handle_turn(self):
"""
Take actions inside of a battle based on the game state.