def generate_map(width, height, layer_count=10): tile_map = TileMap(width=width, height=height, default_terrain=terrain.LayerTypes.Rock) # add splashes of mud and sand add_rock_layers(tile_map, layer_count=layer_count) # add a drainage point and create rivers drainage_coords = Point(random.randint(0, tile_map.width - 1), random.randint(0, tile_map.height - 1)) river_count = random.randint(3,10) for _ in range(0, river_count): add_river(tile_map, drainage_coords) # add random detritus entity_list = entities.tag_search('common', 'natural') if entity_list: for _ in range(0, 50): add_entity_at_random_location(tile_map, random.choice(entity_list)) return tile_map
def test_entity_tag_esarch(): ent_list = entities.tag_search('common', 'natural') assert len(ent_list) > 0 created_entity = ent_list[0]() assert isinstance(created_entity, entities.Entity)