Ejemplo n.º 1
0
def test_just_visiting():
    """"
    Handles test case of landing on the jail/just visting
    """

    sq = Jail()
    p = Player()
    game = Game(players=[p])
    old = game.getPlayers()
    sq.run(0, game)
    ran = game.getPlayers()
    #current player and all players
    assert old == ran
Ejemplo n.º 2
0
def test_player_alive_money():
    game = Game()
    game.setPlayers([Player()])
    player = game.getPlayers()[0]
    player.setMoney(0)
    game.checkMoneyRule(player)
    assert player.getAlive() == False
Ejemplo n.º 3
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.º 4
0
def test_setPlayers():
    game = Game()
    a = [Player(),Player()]
    game.setPlayers(a)
    assert game.getPlayers() != None
Ejemplo n.º 5
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()