def test_event_turn_select_002():
    """手番カード選択."""
    m = old_maid_player_cpu.OldMaidPlayerCpu()
    c = old_maid_player.OldMaidPlayer()
    c.add_hand(trump.Trump(trump.Trump.HEART, 1))
    r = m.event_turn_select(c.get_hand())
    assert r == 0
def test_event_turn_select_003():
    """手番カード選択."""
    m = old_maid_player_cpu.OldMaidPlayerCpu()
    c = old_maid_player.OldMaidPlayer()
    c.add_hand(trump.Trump(trump.Trump.DIAMOND, 8))
    c.add_hand(trump.Trump(trump.Trump.DIAMOND, 10))
    r = m.event_turn_select(c.get_hand())
    assert r == 0 or r == 1
def test_event_turn_start_001():
    """手番開始."""
    m = old_maid_player_cpu.OldMaidPlayerCpu()
    c = old_maid_player.OldMaidPlayer()
    c.add_hand(trump.Trump(trump.Trump.SPADE, 1))
    c.add_hand(trump.Trump(trump.Trump.SPADE, 2))
    c.add_hand(trump.Trump(trump.Trump.SPADE, 3))
    c.add_hand(trump.Trump(trump.Trump.SPADE, 4))
    m.event_turn_start(c.get_hand())
def test_event_turn_select_001():
    """手番カード選択."""
    m = old_maid_player_cpu.OldMaidPlayerCpu()
    c = old_maid_player.OldMaidPlayer()
    c.add_hand(trump.Trump(trump.Trump.SPADE, 1))
    c.add_hand(trump.Trump(trump.Trump.SPADE, 2))
    c.add_hand(trump.Trump(trump.Trump.SPADE, 3))
    c.add_hand(trump.Trump(trump.Trump.SPADE, 4))
    r = m.event_turn_select(c.get_hand())
    assert r >= 0 and r <= 3
Esempio n. 5
0
 def __init__(self, player_count=4):
     """コンストラクタ."""
     # トランプデッキ
     self._deck = trump_deck.TrumpDeck()
     # 捨て札(トランプペアリスト)
     self._trash_list = []
     # プレイヤー
     if player_count < self.MIN_PLAYER or player_count > self.MAX_PLAYER:
         raise ValueError("set player_count >= 2 and player_count <= 26")
     self._players = []
     for _ in range(player_count):
         self._players.append(old_maid_player_cpu.OldMaidPlayerCpu())
     self._player_count = player_count
     # ターン
     self._game_turn = turn.Turn(0, player_count)
     # シーン
     self._game_scene = scene.Scene()
     # 結果
     self._game_result = result.Result()