def setup_world(self): avatar_manager = SimpleAvatarManager() CELLS = [ [ { 'pickup': MockPickup('b'), 'avatar': avatar_manager.avatars[0] }, {}, { 'generates_score': True }, ], [ {}, { 'habitable': False }, { 'pickup': MockPickup('a') }, ], ] grid = { Location(x, y - 1): MockCell(Location(x, y - 1), **CELLS[x][y]) for y in xrange(3) for x in xrange(2) } state_provider.set_world(GameState(WorldMap(grid, {}), avatar_manager)) return service.get_world_state()
def setup_world(self): CELLS = [ [ {}, {'avatar': 'a'}, {'generates_score': True}, ], [ {}, {'habitable': False}, {}, ], ] grid = [[MockCell(Location(x, y), **CELLS[x][y]) for y in xrange(3)] for x in xrange(2)] state_provider.set_world(GameState(WorldMap(grid), SimpleAvatarManager())) return service.get_world_state()
def setup_world(self): avatar_manager = SimpleAvatarManager() CELLS = [ [ {'pickup': MockPickup('b'), 'avatar': avatar_manager.avatars[0]}, {}, {'generates_score': True}, ], [ {}, {'habitable': False}, {'pickup': MockPickup('a')}, ], ] grid = {Location(x, y-1): MockCell(Location(x, y-1), **CELLS[x][y]) for y in xrange(3) for x in xrange(2)} state_provider.set_world(GameState(WorldMap(grid), avatar_manager)) return service.get_world_state()
def setUp(self): """ Sets up the JSON of the world state generated by the service file for testing. """ self.avatar_manager = self.DummyAvatarManager() CELLS = [ [ { 'pickup': MockPickup('b'), 'avatar': self.avatar_manager.avatars[0] }, {}, { 'generates_score': True }, ], [ {}, { 'habitable': False }, { 'pickup': MockPickup('a') }, ], ] grid = { Location(x, y - 1): MockCell(Location(x, y - 1), **CELLS[x][y]) for y in range(3) for x in range(2) } state_provider.set_world( GameState(WorldMap(grid, {}), self.avatar_manager)) self.world_state_json = service.get_game_state()
def setup_world(self): CELLS = [ [ {}, { 'avatar': 'a' }, { 'generates_score': True }, ], [ {}, { 'habitable': False }, {}, ], ] grid = [[MockCell(Location(x, y), **CELLS[x][y]) for y in xrange(3)] for x in xrange(2)] state_provider.set_world( GameState(WorldMap(grid), SimpleAvatarManager())) return service.get_world_state()