示例#1
0
文件: conftest.py 项目: weshec/guard
    def _generate_world(xdim, ydim, sea_tiles):
        communities = [
            Community(default_parameters) for i in range(xdim * ydim)
        ]
        for coordinate in sea_tiles:
            x, y = coordinate
            communities[x + y * xdim] = Community(default_parameters,
                                                  landscape=terrain.sea)

        world = World(xdim, ydim, communities, default_parameters)
        return world
示例#2
0
def strong_polity():
    state_size = 20
    state = polity.Polity(
        [Community(default_parameters) for i in range(state_size)])
    for tile in state.communities:
        tile.ultrasocietal_traits = ([True] *
                                     default_parameters.n_ultrasocietal_traits)
    return state
示例#3
0
def weak_polity():
    state_size = 1
    state = polity.Polity(
        [Community(default_parameters) for i in range(state_size)])
    return state
示例#4
0
def mediocre_polity():
    state_size = 5
    state = polity.Polity(
        [Community(default_parameters) for i in range(state_size)])
    return state
示例#5
0
def polity_10():
    state = polity.Polity(
        [Community(default_parameters) for i in range(10)]
        )
    return state
示例#6
0
 def test_new_community(self, polity_10):
     state = polity_10
     state.add_community(Community(default_parameters))
     assert state.communities[-1].polity is state
示例#7
0
 def test_add_community(self, polity_10):
     state = polity_10
     state.add_community(Community(default_parameters))
     assert state.size() == 11
示例#8
0
 def _arbitrary_polity(size):
     state = polity.Polity(
         [Community(default_parameters) for i in range(size)]
         )
     return state
示例#9
0
 def _basic_community(params=default_parameters):
     return Community(params)
示例#10
0
    def test_steppe_community(self):
        tile = Community(default_parameters, landscape=terrain.steppe)

        assert (
            tile.total_military_techs() == default_parameters.n_military_techs)
示例#11
0
def advanced_community():
    tile = Community(default_parameters)
    tile.military_techs = [True] * default_parameters.n_military_techs
    return tile
示例#12
0
文件: conftest.py 项目: weshec/guard
def world_5x5():
    communities = [Community(default_parameters) for i in range(25)]
    world = World(5, 5, communities, default_parameters)
    return world
示例#13
0
文件: conftest.py 项目: weshec/guard
 def _generate_world(xdim, ydim, params=default_parameters):
     communities = [Community(params) for i in range(xdim * ydim)]
     world = World(xdim, ydim, communities, params)
     return world