Exemple #1
0
        for i in range(count):
            card = cards.get(name)
            if card is not None:
                cardObject = createCardObject(g, card)
                c1.append(cardObject)
            else:
                print ("Card %s doesn't exist!" % name)

    random.shuffle(c1)
    g.create_player("Player1", c1)

    c2 = []
    for count, name in parse_deckfile(sys.argv[2]):
        for i in range(count):
            card = cards.get(name)
            if card is not None:
                cardObject = createCardObject(g, card)
                c2.append(cardObject)
            else:
                print ("Card %s doesn't exist!" % name)

    random.shuffle(c2)
    g.create_player("Player2", c2)

    g.process_push(MainGameProcess())

    input_generator(g)
    # process_game(g)


Exemple #2
0
    #recv_address = sys.argv[3]

    #print `(broker, send_address, recv_address)`
    #connection = Connection(broker)
    #connection.open()
    #session = connection.session()

    #send = session.sender(send_address)
    #recv = session.receiver(recv_address)

    #output = AMQPOutput(send)

    #ig = amqp_input_generator(session, send, recv)

    output = Output()
    ig = input_generator()

    n = ig.next()
    g = Game(ig, output)
    g.create()
    
    c1 = []
    c1.append (g.create_card ("Plains", None, set(["basic"]), set(["land"]), set(), set(), "[W]", None, None))
    c1.append (g.create_card ("Plains", None, set(["basic"]), set(["land"]), set(), set(), "[W]", None, None))
    c1.append (g.create_card ("Hasty Moggie Bird", "W", set(), set(["creature"]), set(["bird"]), set(["flying","haste"]), "when SELF comes into play, each player loses 1 life.", 1, 1))
    c1.append (g.create_card ("Plains", None, set(["basic"]), set(["land"]), set(), set(), "[W]", None, None))
    c1.append (g.create_card ("Plains", None, set(["basic"]), set(["land"]), set(), set(), "[W]", None, None))
    c1.append (g.create_card ("Moggie Bird", "W", set(), set(["creature"]), set(["bird"]), set(["flying"]), "when SELF comes into play, each player loses 1 life.", 1, 1))
    c1.append (g.create_card ("Plains", None, set(["basic"]), set(["land"]), set(), set(), "[W]", None, None))
    c1.append (g.create_card ("Plains", None, set(["basic"]), set(["land"]), set(), set(), "[W]", None, None))
    c1.append (g.create_card ("Moggie Bird", "W", set(), set(["creature"]), set(["bird"]), set(["flying"]), "when SELF comes into play, each player loses 1 life.", 1, 1))