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:
@@ -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, {
|
||||
|
||||
Reference in New Issue
Block a user