Move more code into separate classes

It might make logical sense.  Honestly, I'm just tired of the code for
World being so long.
This commit is contained in:
Nate Bowman
2026-07-30 19:33:05 -04:00
parent d7dcc0d873
commit e25abd87ab
4 changed files with 44 additions and 40 deletions

View File

@@ -1,12 +1,19 @@
from collections import defaultdict
from aoe.types import *
from aoe.exceptions import *
class Production():
def check_production(self, world, thing):
building = self.building[thing]
if world.production_available[building] < 1:
raise ProductionBuildingNotAvailableException
# assumes for now each unit can be built in only one type of building
def __init__(self):
self.building = defaultdict(None, {