コード例 #1
0
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
コード例 #2
0
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
コード例 #3
0
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
コード例 #4
0
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
コード例 #5
0
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
コード例 #6
0
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
コード例 #7
0
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
コード例 #8
0
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
コード例 #9
0
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
コード例 #10
0
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
コード例 #11
0
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