Add functions to gameplay class

This commit is contained in:
Nate Bowman
2026-11-06 19:16:22 -05:00
parent 622bdc38fb
commit 54050235f0

View File

@@ -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: