Exemplo n.º 1
0
 def test_link_with(self):
     manager = gm.GameManager()
     europe = sample.continent.Continent("Europe", 5, manager)
     asie = sample.continent.Continent("Asie", 7, manager)
     t1 = Territoire("Ukraine", manager, europe, "cav")
     t2 = Territoire("Oural", manager, asie, "cav")
     t1.link_with(t2)
     assert t1 in t2.voisins
Exemplo n.º 2
0
 def test_get_master(self):
     manager = gm.GameManager()
     continent = sample.continent.Continent("Asie", 7, manager)
     continent.territoires = (sample.territoire.Territoire(
         "Chine", continent, manager, "rien"),
                              sample.territoire.Territoire(
                                  "Oural", continent, manager, "rien"))
     player = sample.player.Player(manager)
     for territoire in continent.territoires:
         territoire.proprietaire = player
     assert continent.get_master() is player
     continent.territoires[0].proprietaire = None
     assert continent.get_master() is None
Exemplo n.º 3
0
def create_data():
    manager = gm.GameManager()
    card_sets = {
        ("fantassin", "cavalier", "canon"): 10,
        ("fantassin", "fantassin", "fantassin"): 4,
        ("cavalier", "cavalier", "cavalier"): 6,
        ("canon", "canon", "canon"): 8,
    }
    manager.card_sets = card_sets
    player = sample.player.Player(manager, ai.IaForTest, "red",
                                  msn.BaseMission)
    player2 = sample.player.Player(manager, ai.IaForTest)
    continent = sample.continent.Continent("Asie", 7, manager)
    a = sample.territoire.Territoire("Chine", "Asie", manager, "canon")
    b = sample.territoire.Territoire("Oural", "Asie", manager, "canon")
    c = sample.territoire.Territoire("Siam", "Asie", manager, "canon")
    a.link_with(b)
    a.change_owner(player)
    b.change_owner(player)
    c.change_owner(player)
    player.cards = [a, b, c]
    return locals()
Exemplo n.º 4
0
def create_data():
    manager = gm.GameManager()
    continent = ctn.Continent("Asie", 7, manager)
    return locals()
Exemplo n.º 5
0
def create_data():
    manager = gm.GameManager()
    continent = ctn.Continent("Asie", 7, manager)
    chine = trt.Territoire("chine", continent, manager, "cavalier")
    oural = trt.Territoire("oural", continent, manager, "canon")
    return locals()