def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.task = Task(self, 'wait')
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.task = Task(self, 'wait')
def task_move(self, direction):
move_pos(direction, self.position)
def task_move(self, direction):
move_pos(direction, self.position)
Decrements .task.todo; if it thus falls to <= 0, enacts method whose
name is 'task_' + self.task.name and sets .task = None. If is_AI, calls
.decide_task to decide a self.task.
Decrements .task.todo; if it thus falls to <= 0, enacts method whose
name is 'task_' + self.task.name and sets .task = None. If is_AI, calls
.decide_task to decide a self.task.
- def cmd_GET_TURN(self, connection_id):
- """Send world.turn to caller."""
- self.send_to(connection_id, str(self.world.turn))
+ def cmd_GET_GAMESTATE(self, connection_id):
+ """Send game state jto caller."""
+ self.send_gamestate(connection_id)
def cmd_ECHO(self, msg, connection_id):
"""Send msg to caller."""
def cmd_ECHO(self, msg, connection_id):
"""Send msg to caller."""