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
def test_complete_waives(self): board = Map(standard) board.handle_NOW(NOW(WIN, 1901)(RUS, AMY, MOS)) orders = OrderSet() orders.complete_set(board) self.failUnlessEqual(len(orders), 21)