Combine unit and research functions

This commit is contained in:
Nate Bowman
2026-07-28 19:51:05 -04:00
parent ebd3858aef
commit 3bcc133674
3 changed files with 83 additions and 105 deletions

View File

@@ -1,3 +1,5 @@
from collections import defaultdict
from aoe.types import *
@@ -7,7 +9,7 @@ class Production():
# assumes for now each unit can be built in only one type of building
def __init__(self):
self.building = {
self.building = defaultdict(None, {
Units.VILLAGER: Buildings.TOWNCENTER,
Units.TRADECART: Buildings.MARKET,
Units.SPEARMAN: Buildings.BARRACKS,
@@ -93,4 +95,4 @@ class Production():
Research.LOOM: Buildings.TOWNCENTER,
Research.SAPPERS: Buildings.CASTLE,
Research.BOMBARDTOWER: Buildings.UNIVERSITY,
}
})