def _test_adjutant(self): self._test_declare() # Napoleon decides the card of adjutant as culb ace p = list(self.state.players)[0] adjutant = card.from_int(1) p.decide(adjutant) assert self.state.adjutant == adjutant
def _test_declare(self): self._test_start() # only one player declares as Napoleon # while others passes players = list(self.state.players) for p in players[1:]: p.pass_() assert len(list(self.state._passed_players)) == len(players) - 1 declaration = card.from_int(1) p = players[0] p.declare(declaration) assert self.state.declaration == declaration assert p.is_napoleon
def act(self, adjutant): self.player.decide(card.from_int(int(adjutant))) self.player.state.set_role(card.from_int(int(adjutant))) self.player.add_rest_to_hand()
def act(self, declaration): self.player.declare(card.from_int(int(declaration)))
def act(self, selected): # check turn user if self.player.state.phase.waiting_next_turn: self.next_round() self.player.select(card.from_int(int(selected)))
def player_cards(self): d = self.adaptor.get_dict("player_cards", type=int) if d: return {k: card.from_int(v) for k, v in d.items()} else: return {}
def adjutant(self): d = self.adaptor.get("adjutant") if d: return card.from_int(int(d))