Add ability to automatically queue villagers
This commit is contained in:
@@ -55,6 +55,14 @@ class Gameplay():
|
||||
(research,)))
|
||||
|
||||
|
||||
def queue_villagers_over_time(self, from_time, until_time, initial_task):
|
||||
train_time = self.world.build_times.build_times[Units.VILLAGER]
|
||||
duration = max(0, until_time - from_time)
|
||||
|
||||
for i in range(duration//train_time + 1):
|
||||
self.queue_villager(from_time + i*train_time, initial_task)
|
||||
|
||||
|
||||
def queue_villager(self, action_time, initial_task):
|
||||
self._check_time(action_time)
|
||||
self.actions[action_time].append((self.world.queue_villager,
|
||||
|
||||
Reference in New Issue
Block a user