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 check_order(self, order, result): order = createUnitOrder(order, standard_map.powers[FRA], standard_map, DatcOptions()) self.failUnlessEqual(str(order), result)