Add ability to automatically queue villagers

This commit is contained in:
Nate Bowman
2026-11-08 21:00:32 -05:00
parent c02aa3f736
commit ec8b33ac00
2 changed files with 19 additions and 0 deletions

View File

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