aboutsummaryrefslogtreecommitdiff
path: root/diplomacy/client/network_game.py
diff options
context:
space:
mode:
authornotoraptor <stevenbocco@gmail.com>2019-08-27 21:04:36 -0400
committerPhilip Paquette <pcpaquette@gmail.com>2019-08-28 06:15:47 -0400
commitb0521bedc67dfee438acc26645e1339f0caafbe2 (patch)
treef74dee7473856c3ac76c572e66197493590a780a /diplomacy/client/network_game.py
parent2e26ae581062ca636dd02718e7cbbf71e022b04a (diff)
Make sure to clear all orders before setting a new game state.
Diffstat (limited to 'diplomacy/client/network_game.py')
-rw-r--r--diplomacy/client/network_game.py23
1 files changed, 0 insertions, 23 deletions
diff --git a/diplomacy/client/network_game.py b/diplomacy/client/network_game.py
index e75687f..368d1d2 100644
--- a/diplomacy/client/network_game.py
+++ b/diplomacy/client/network_game.py
@@ -21,7 +21,6 @@ from diplomacy.client.channel import Channel
from diplomacy.communication import notifications
from diplomacy.engine.game import Game
from diplomacy.utils.exceptions import DiplomacyException
-from diplomacy.utils.game_phase_data import GamePhaseData
LOGGER = logging.getLogger(__name__)
@@ -175,25 +174,3 @@ class NetworkGame(Game):
""" Notify game with given notification (call associated callbacks if defined). """
for callback in self.notification_callbacks.get(type(notification), ()):
callback(self, notification)
-
- def set_phase_data(self, phase_data, clear_history=True):
- """ Overwrite base method to prevent call to channel methods. """
- if not phase_data:
- return
- if isinstance(phase_data, GamePhaseData):
- phase_data = [phase_data]
- elif not isinstance(phase_data, list):
- phase_data = list(phase_data)
-
- if clear_history:
- self._clear_history()
-
- for game_phase_data in phase_data[:-1]: # type: GamePhaseData
- Game.extend_phase_history(self, game_phase_data)
-
- current_phase_data = phase_data[-1] # type: GamePhaseData
- Game.set_state(self, current_phase_data.state, clear_history=clear_history)
- for power_name, power_orders in current_phase_data.orders.items():
- Game.set_orders(self, power_name, power_orders)
- self.messages = current_phase_data.messages.copy()
- # We ignore 'results' for current phase data.