Ejemplo n.º 1
0
def test_game_over_true():
    game = Game()
    game.setPlayers([Player(),Player()])
    a = game.getPlayers()
    a[1].setAlive(False)
    game.checkGameOver()
    assert game.getGameOver() == True
Ejemplo n.º 2
0
def test_game_over_false_mult():
    game = Game()
    game.setPlayers([Player(),Player()])
    game.checkGameOver()
    assert game.getGameOver() == False
Ejemplo n.º 3
0
from Game.Game import Game
from Game.TurnOrder import TurnOrder
from Game.rules import Rules
if __name__ == "__main__":
    game = Game()
    turn = TurnOrder(range(len(game.getPlayers())))
    order = iter(turn)
    manager = Rules(game)
    while (not game.getGameOver()):
        currentPlayer = game.getPlayer(next(order))
        roll1 = random()
        roll2 = random()
        manager.roll(currentPlayer, roll1, roll2)
        manager.landSquare()
        #game.action(handleInput())
        #trade . upgrade . end
        #accept end turn or other actions
        #GUI.update(game)
        game.checkGameOver()