Add functions to gameplay class
This commit is contained in:
@@ -49,6 +49,11 @@ class Gameplay():
|
||||
(initial_task,)))
|
||||
|
||||
|
||||
def queue_unit(self, action_time, unit):
|
||||
self._check_time(action_time)
|
||||
self.actions[action_time].append((self.world.queue_unit, (unit,)))
|
||||
|
||||
|
||||
def assign_villager(self, action_time, old_task, new_task, count=1):
|
||||
self._check_time(action_time)
|
||||
self.actions[action_time].append((self.world.assign_villager,
|
||||
@@ -64,6 +69,11 @@ class Gameplay():
|
||||
(previous_task, walking_time)))
|
||||
|
||||
|
||||
def increase_age(self, action_time):
|
||||
self._check_time(action_time)
|
||||
self.actions[action_time].append((self.world.increase_age, ()))
|
||||
|
||||
|
||||
def _check_time(self, action_time):
|
||||
# TODO will it work if we do something at current time?
|
||||
if self.world.current_time > action_time:
|
||||
|
||||
Reference in New Issue
Block a user