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,22 @@
|
||||
from collections import defaultdict
|
||||
|
||||
from aoe.types import *
|
||||
from aoe.exceptions import *
|
||||
|
||||
|
||||
|
||||
class Housing():
|
||||
|
||||
|
||||
def check_housing(self, world, thing):
|
||||
required = self.required[thing]
|
||||
|
||||
if required > 0:
|
||||
pop_space = world.get_population_space()
|
||||
if world.get_effective_population() > pop_space + required:
|
||||
raise YallGotHousedException
|
||||
|
||||
|
||||
def __init__(self):
|
||||
self.space = defaultdict(int, {
|
||||
Buildings.HOUSE: 5,
|
||||
|
||||
Reference in New Issue
Block a user