def __hitWall(self, cookie):
     service = PlayerService()
     player = service.get(cookie.playerId)
     previousSpace = self.playerGrid.getMapSpace(cookie.position)
     previousSpace.cookies.remove(cookie)
     player.getHitByCookie(cookie)
     service.save(player)
     return (cookie, player)
Exemplo n.º 2
0
 def __hitWall(self, cookie):
     service = PlayerService()
     player = service.get(cookie.playerId)
     previousSpace = self.playerGrid.getMapSpace(cookie.position)
     previousSpace.cookies.remove(cookie)
     player.getHitByCookie(cookie)
     service.save(player)
     return (cookie, player)
 def __hitPlayer(self, cookie, nextMapSpace):
     service = PlayerService()
     previousPlayer = service.get(cookie.playerId)
     previousSpace = self.playerGrid.getMapSpace(cookie.position)
     previousSpace.cookies.remove(cookie)
     hitPlayer = nextMapSpace.players[0]
     hitPlayer.getHitByCookie(cookie)
     service.save(hitPlayer)
     if len(previousPlayer.cookies) == 0:
         raise WinnerFound(previousPlayer.playerId)
     return (cookie, hitPlayer)
Exemplo n.º 4
0
 def __hitPlayer(self, cookie, nextMapSpace):
     service = PlayerService()
     previousPlayer = service.get(cookie.playerId)
     previousSpace = self.playerGrid.getMapSpace(cookie.position)
     previousSpace.cookies.remove(cookie)
     hitPlayer = nextMapSpace.players[0]
     hitPlayer.getHitByCookie(cookie)
     service.save(hitPlayer)
     if len(previousPlayer.cookies) == 0:
         raise WinnerFound(previousPlayer.playerId)
     return (cookie, hitPlayer)