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()
示例#2
0
 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()
示例#3
0
 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()
示例#4
0
    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()
示例#5
0
 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()