def generateCrous(matrix, p, height_map): logging.info("Generating a crous apt in lot {}".format(p)) logging.info("Terrain before flattening: ") for x in range(p[2], p[3]): line = "" for z in range(p[4], p[5]): line += str(height_map[x][z]) + " " logging.info(line) h = prepareLot(matrix, p, height_map) logging.info("Terrain after flattening: ") for x in range(p[2], p[3]): line = "" for z in range(p[4], p[5]): line += str(height_map[x][z]) + " " logging.info(line) crous = GenerateCrous.generateCrous(matrix, h, p[1], p[2], p[3], p[4], p[5]) utilityFunctions.updateHeightMap(height_map, p[2] + 1, p[3] - 1, p[4] + 1, p[5] - 1, -1) logging.info("Terrain after construction: ") for x in range(p[2], p[3]): line = "" for z in range(p[4], p[5]): line += str(height_map[x][z]) + " " logging.info(line) return crous
def generateHouse(matrix, p, height_map, usable_wood, biome): logging.info("Generating a house in lot {}".format(p)) logging.info("Terrain before flattening: ") for x in range(p[2], p[3]): line = "" for z in range(p[4], p[5]): line += str(height_map[x][z]) + " " logging.info(line) h = prepareLot(matrix, p, height_map, biome) logging.info("Terrain after flattening: ") for x in range(p[2], p[3]): line = "" for z in range(p[4], p[5]): line += str(height_map[x][z]) + " " logging.info(line) house = GenerateHouse.generateHouse(matrix, h, p[1], p[2], p[3], p[4], p[5], biome, usable_wood) utilityFunctions.updateHeightMap(height_map, p[2] + 1, p[3] - 1, p[4] + 1, p[5] - 1, -1) logging.info("Terrain after construction: ") for x in range(p[2], p[3]): line = "" for z in range(p[4], p[5]): line += str(height_map[x][z]) + " " logging.info(line) return house
def generateWell(matrix, p, height_map, biome): h = prepareLot(matrix, p, height_map, biome) well = GenerateWell.generateWell(matrix, h, p[1], p[2], p[3], p[4], p[5], biome) utilityFunctions.updateHeightMap(height_map, p[2] + 1, p[3] - 2, p[4] + 1, p[5] - 2, -1) return well
def generateBuilding(matrix, p, height_map): h = prepareLot(matrix, p, height_map) building = GenerateBuilding.generateBuilding(matrix, h, p[1], p[2], p[3], p[4], p[5]) utilityFunctions.updateHeightMap(height_map, p[2] + 1, p[3] - 2, p[4] + 1, p[5] - 2, -1) return building
def generateGreenhouse(matrix, p, height_map, usable_wood, biome): h = prepareLot(matrix, p, height_map, biome) greenhouse = GenerateGreenhouse.generateGreenhouse(matrix, h, p[1], p[2], p[3], p[4], p[5], usable_wood, biome) utilityFunctions.updateHeightMap(height_map, p[2] + 3, p[3] - 3, p[4] + 2, p[5] - 2, -1) return greenhouse
def generateFountain(matrix, p, height_map, simple_height_map): logging.info("Generating a fountain in lot {}".format(p)) h = prepareLot(matrix, p, height_map, (43, 8)) building = Fountain.generateFountain(matrix, h, p[1], p[2], p[3], p[4], p[5]) toolbox.updateHeightMap(height_map, p[2] + 1, p[3] - 1, p[4] + 1, p[5] - 1, -1) toolbox.updateHeightMap(simple_height_map, p[2] + 1, p[3] - 1, p[4] + 1, p[5] - 1, -1) return building
def generateHouse(matrix, p, height_map, simple_height_map, wood_material): logging.info("Generating a house in lot {}".format(p)) h = prepareLot(matrix, p, height_map, None) house = House.generateHouse(matrix, wood_material, h, p[1], p[2], p[3], p[4], p[5]) toolbox.updateHeightMap(height_map, p[2] + 1, p[3] - 1, p[4] + 1, p[5] - 1, -1) toolbox.updateHeightMap(simple_height_map, p[2] + 1, p[3] - 1, p[4] + 1, p[5] - 1, -1) return house
def generateFarm(matrix, p, height_map, simple_height_map, farmType=None): logging.info("Generating a farm in lot {}".format(p)) h = prepareLot(matrix, p, height_map, None) farm = GenerateFarm.generateFarm(matrix, h, p[1], p[2], p[3], p[4], p[5], farmType) utilityFunctions.updateHeightMap(height_map, p[2] + 1, p[3] - 2, p[4] + 1, p[5] - 2, -1) utilityFunctions.updateHeightMap(simple_height_map, p[2] + 1, p[3] - 2, p[4] + 1, p[5] - 2, -1) return farm
def generateHouse(matrix, p, height_map, simple_height_map): logging.info("Generating a house in lot {}".format(p)) h = prepareLot(matrix, p, height_map, None) house = GenerateHouse.generateHouse(matrix, h, p[1], p[2], p[3], p[4], p[5]) utilityFunctions.updateHeightMap(height_map, p[2] + 1, p[3] - 1, p[4] + 1, p[5] - 1, -1) utilityFunctions.updateHeightMap(simple_height_map, p[2] + 1, p[3] - 1, p[4] + 1, p[5] - 1, -1) return house
def generateBuilding(matrix, p, height_map, simple_height_map): logging.info("Generating a building in lot {}".format(p)) h = prepareLot(matrix, p, height_map, (43, 8)) building = GenerateBuilding.generateBuilding(matrix, h, p[1], p[2], p[3], p[4], p[5]) utilityFunctions.updateHeightMap(height_map, p[2] + 1, p[3] - 1, p[4] + 1, p[5] - 1, -1) utilityFunctions.updateHeightMap(simple_height_map, p[2] + 1, p[3] - 1, p[4] + 1, p[5] - 1, -1) return building
def generateFarm(matrix, p, height_map, simple_height_map, wood_material, farmType=None): logging.info("Generating a farm in lot {}".format(p)) h = prepareLot(matrix, p, height_map, None) farm = Farm.generateFarm(matrix, wood_material, h, p[1], p[2], p[3], p[4], p[5], farmType) toolbox.updateHeightMap(height_map, p[2] + 1, p[3] - 2, p[4] + 1, p[5] - 2, -1) return farm