예제 #1
0
    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
예제 #2
0
    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
예제 #3
0
파일: phase.py 프로젝트: her0e1c1/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()
예제 #4
0
파일: phase.py 프로젝트: her0e1c1/Napoleon
 def act(self, declaration):
     self.player.declare(card.from_int(int(declaration)))
예제 #5
0
파일: phase.py 프로젝트: her0e1c1/Napoleon
 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)))
예제 #6
0
 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 {}
예제 #7
0
 def adjutant(self):
     d = self.adaptor.get("adjutant")
     if d:
         return card.from_int(int(d))