コード例 #1
0
ファイル: player.py プロジェクト: eswald/parlance
 def collect_orders(self, now, sco, country):
     orders = OrderSet()
     datc = DatcOptions()
     board = Map(self.variant)
     if sco:
         board.handle_SCO(sco)
     if now:
         board.handle_NOW(now)
     power = board.powers[country]
     phase = board.current_turn.phase()
     self.start_game(now, sco, country)
     for msg in self.replies:
         if msg[0] is SUB:
             for item in msg.fold()[1:]:
                 order = createUnitOrder(item, power, board, datc)
                 note = order.order_note(power, phase, orders)
                 self.failUnlessEqual(note, MBV)
                 orders.add(order, country)
         elif msg[0] is NOT and msg[2] is SUB:
             # Todo: Handle partial unsubmittals correctly.
             orders = OrderSet()
     return phase, power, orders
コード例 #2
0
ファイル: gameboard.py プロジェクト: eswald/parlance
 def check_order(self, order, result):
     order = createUnitOrder(order, standard_map.powers[FRA], standard_map, DatcOptions())
     self.failUnlessEqual(str(order), result)
コード例 #3
0
 def check_order(self, order, result):
     order = createUnitOrder(order, standard_map.powers[FRA], standard_map,
                             DatcOptions())
     self.failUnlessEqual(str(order), result)