domain

domain

import "github.com/yuta-yoshinaga/go_trumpcards/internal/domain"

Index

Constants

バカラフェーズ定数

const (
    BaccaratPhaseBet = 1 // ベットフェーズ
    BaccaratPhaseEnd = 2 // 終了フェーズ
)

バカラベットタイプ定数

const (
    BaccaratBetPlayer = 0 // プレイヤーベット
    BaccaratBetBanker = 1 // バンカーベット
    BaccaratBetTie    = 2 // タイベット
)

バカラデフォルト値

const (
    BaccaratDefaultChips    = 1000  // デフォルトチップ
    BaccaratMinBet          = 10    // 最低ベット額
    BaccaratMaxBet          = 10000 // 最大ベット額
    BaccaratCommissionRate  = 5     // バンカーコミッション率(%)
    BaccaratTiePayoutRate   = 8     // タイ配当倍率
    BaccaratNaturalMinValue = 8     // ナチュラル最小値
    BaccaratDrawMaxValue    = 5     // プレイヤードロー閾値
    BaccaratStandMinValue   = 7     // スタンド最小値
)

バカラ結果定数(罫線用)

const (
    BaccaratResultPlayer = 0 // プレイヤー勝利
    BaccaratResultBanker = 1 // バンカー勝利
    BaccaratResultTie    = 2 // タイ
)

バカラサイドベット種類定数

const (
    BacSideBetPlayerPair = 1
    BacSideBetBankerPair = 2
)

バカラペア結果定数

const (
    BacPairNone  = 0
    BacPairMatch = 1
)

ブラックジャックフェーズ定数

const (
    BJPhaseBet            = 1 // ベットフェーズ
    BJPhaseDeal           = 2 // ディールフェーズ
    BJPhaseInsurance      = 3 // インシュランスフェーズ
    BJPhaseAction         = 4 // アクションフェーズ
    BJPhaseEnd            = 5 // 終了フェーズ
    BJPhaseEarlySurrender = 6 // アーリーサレンダーフェーズ
)

ブラックジャックデフォルト値

const (
    BJDefaultChips      = 1000  // デフォルトチップ
    BJMinBet            = 10    // 最低ベット額
    BJMaxBet            = 10000 // 最大ベット額(オーバーフロー防止)
    BJMaxHands          = 4     // スプリットによる最大ハンド数(単一初期ハンド時)
    BJMaxInitialHands   = 3     // マルチハンド最大初期ハンド数
    BJMaxMultiHandTotal = 8     // マルチハンド時の総ハンド数上限
    BJDefaultDecks      = 1     // デフォルトデッキ数
)

カウンティングシステム定数

const (
    BJCountingHiLo    = 0 // Hi-Lo
    BJCountingKO      = 1 // Knock-Out (KO)
    BJCountingZen     = 2 // Zen Count
    BJCountingOmegaII = 3 // Omega II
    BJCountingMax     = 3 // 最大値
)

サレンダールール定数

const (
    BJSurrenderLate  = 0 // レイトサレンダー(デフォルト)
    BJSurrenderEarly = 1 // アーリーサレンダー
    BJSurrenderNone  = 2 // サレンダー無効
    BJSurrenderMax   = 2 // 最大値
)

デッキペネトレーション定数

const (
    BJDefaultPenetration = 75 // デフォルトペネトレーション率(%)
    BJPenetrationMin     = 50 // 最小ペネトレーション率(%)
    BJPenetrationMax     = 75 // 最大ペネトレーション率(%)
)

サイドベット種類定数

const (
    BJSideBetPerfectPairs = 1
    BJSideBet21Plus3      = 2
)

Perfect Pairs 結果定数

const (
    BJPPNone        = 0 // ペアなし
    BJPPMixedPair   = 1 // ミックスペア(異色同数)
    BJPPColoredPair = 2 // カラードペア(同色同数)
    BJPPPerfectPair = 3 // パーフェクトペア(同柄同数)
)

Perfect Pairs 配当倍率

const (
    BJPPMixedPairPayout   = 6
    BJPPColoredPairPayout = 12
    BJPPPerfectPairPayout = 25
)

21+3 結果定数

const (
    BJT3None          = 0 // なし
    BJT3Flush         = 1 // フラッシュ
    BJT3Straight      = 2 // ストレート
    BJT3ThreeOfAKind  = 3 // スリーオブアカインド
    BJT3StraightFlush = 4 // ストレートフラッシュ
    BJT3SuitedTrips   = 5 // スーテッドトリップス
)

21+3 配当倍率

const (
    BJT3FlushPayout         = 5
    BJT3StraightPayout      = 10
    BJT3ThreeOfAKindPayout  = 30
    BJT3StraightFlushPayout = 40
    BJT3SuitedTripsPayout   = 100
)

ビッドスート定数 (ランク順: Clubs < Diamonds < Hearts < Spades < NoTrump)

const (
    BridgeBidSuitClub    = 1
    BridgeBidSuitDiamond = 2
    BridgeBidSuitHeart   = 3
    BridgeBidSuitSpade   = 4
    BridgeBidSuitNT      = 5
)

カナスタスコア定数

const (
    CanastaGoingOutBonus          = 100 // 上がりボーナス
    CanastaConcealedGoingOutBonus = 200 // コンシールド上がりボーナス (一度もメルドせずに上がる)
    CanastaNaturalCanastaBonus    = 500 // ナチュラルカナスタボーナス (ワイルドなし)
    CanastaMixedCanastaBonus      = 300 // ミックスカナスタボーナス (ワイルドあり)
    CanastaRed3Bonus              = 100 // 赤3のボーナス (1枚あたり)
    CanastaAllRed3Bonus           = 800 // 赤3全4枚ボーナス
)

カード定数

const (
    CardDesignJoker   = 0
    CardDesignSpade   = 1
    CardDesignClover  = 2
    CardDesignHeart   = 3
    CardDesignDiamond = 4
    CardDesignMin     = CardDesignJoker
    CardDesignMax     = CardDesignDiamond
    CardValueJoker    = 0
    CardValueMin      = 0
    CardValueMax      = 13
    CardCnt           = (CardValueMax * 4)
)

ランク定数

const (
    DaifugoRankDaifugo   = 1 // 大富豪
    DaifugoRankFugo      = 2 // 富豪
    DaifugoRankHeimin    = 3 // 平民
    DaifugoRankDaihinmin = 4 // 大貧民
)

カード交換枚数

const (
    DaifugoExchangeCountDaifugo = 2 // 大富豪↔大貧民: 2枚
    DaifugoExchangeCountFugo    = 1 // 富豪↔平民: 1枚
)

フェーズ定数

const (
    HoldemPhaseInit     = 0 // 初期状態
    HoldemPhasePreFlop  = 1 // プリフロップ
    HoldemPhaseFlop     = 2 // フロップ
    HoldemPhaseTurn     = 3 // ターン
    HoldemPhaseRiver    = 4 // リバー
    HoldemPhaseShowdown = 5 // ショーダウン
    HoldemPhaseEnd      = 6 // ゲーム終了
    HoldemPhaseRebuy    = 7 // リバイ/アドオン待ち
)

アクション定数 (共通定数のエイリアス)

const (
    HoldemActionFold  = bettingActionFold  // フォールド
    HoldemActionCheck = bettingActionCheck // チェック
    HoldemActionCall  = bettingActionCall  // コール
    HoldemActionBet   = bettingActionBet   // ベット
    HoldemActionRaise = bettingActionRaise // レイズ
    HoldemActionAllIn = bettingActionAllIn // オールイン
)

リバイフェーズ種別定数

const (
    HoldemRebuyPhaseNone  = 0 // なし
    HoldemRebuyPhaseRebuy = 1 // リバイ待ち
    HoldemRebuyPhaseAddon = 2 // アドオン待ち
)

テーブルサイズ定数

const (
    HoldemTableSize4 = 4 // 4-max (1 human + 3 CPU)
    HoldemTableSize6 = 6 // 6-max (1 human + 5 CPU)
    HoldemTableSize9 = 9 // 9-max (1 human + 8 CPU)
)

フェーズ定数

const (
    IndianPokerPhaseInit     = 0 // 初期状態
    IndianPokerPhaseAnte     = 1 // アンティ投入済み
    IndianPokerPhaseBetting  = 2 // ベッティングラウンド
    IndianPokerPhaseShowdown = 3 // ショーダウン
    IndianPokerPhaseEnd      = 4 // ゲーム終了
)

アクション定数 (共通定数のエイリアス)

const (
    IndianPokerActionFold  = bettingActionFold  // フォールド
    IndianPokerActionCheck = bettingActionCheck // チェック
    IndianPokerActionCall  = bettingActionCall  // コール
    IndianPokerActionBet   = bettingActionBet   // ベット
    IndianPokerActionRaise = bettingActionRaise // レイズ
    IndianPokerActionAllIn = bettingActionAllIn // オールイン
)

NapoleonWinnerTeam 勝利チーム

const (
    // NapoleonWinnerUndecided 未確定
    NapoleonWinnerUndecided = -1
    // NapoleonWinnerNapoleon ナポレオン軍の勝利
    NapoleonWinnerNapoleon = 0
    // NapoleonWinnerAllied 連合軍の勝利
    NapoleonWinnerAllied = 1
)

オマハフェーズ定数 (Holdemと共通)

const (
    OmahaPhaseInit     = HoldemPhaseInit
    OmahaPhasePreFlop  = HoldemPhasePreFlop
    OmahaPhaseFlop     = HoldemPhaseFlop
    OmahaPhaseTurn     = HoldemPhaseTurn
    OmahaPhaseRiver    = HoldemPhaseRiver
    OmahaPhaseShowdown = HoldemPhaseShowdown
    OmahaPhaseEnd      = HoldemPhaseEnd
    OmahaPhaseRebuy    = HoldemPhaseRebuy
)

オマハアクション定数 (Holdemと共通)

const (
    OmahaActionFold  = HoldemActionFold
    OmahaActionCheck = HoldemActionCheck
    OmahaActionCall  = HoldemActionCall
    OmahaActionBet   = HoldemActionBet
    OmahaActionRaise = HoldemActionRaise
    OmahaActionAllIn = HoldemActionAllIn
)

リバイフェーズ種別定数 (Holdemと共通)

const (
    OmahaRebuyPhaseNone  = HoldemRebuyPhaseNone
    OmahaRebuyPhaseRebuy = HoldemRebuyPhaseRebuy
    OmahaRebuyPhaseAddon = HoldemRebuyPhaseAddon
)

パイナップルフェーズ定数 (Holdemと共通 + ディスカードフェーズ)

const (
    PineapplePhaseInit     = HoldemPhaseInit
    PineapplePhasePreFlop  = HoldemPhasePreFlop
    PineapplePhaseFlop     = HoldemPhaseFlop
    PineapplePhaseTurn     = HoldemPhaseTurn
    PineapplePhaseRiver    = HoldemPhaseRiver
    PineapplePhaseShowdown = HoldemPhaseShowdown
    PineapplePhaseEnd      = HoldemPhaseEnd
    PineapplePhaseRebuy    = HoldemPhaseRebuy
    PineapplePhaseDiscard  = 8 // フロップ後のディスカードフェーズ
)

パイナップルアクション定数 (Holdemと共通)

const (
    PineappleActionFold  = HoldemActionFold
    PineappleActionCheck = HoldemActionCheck
    PineappleActionCall  = HoldemActionCall
    PineappleActionBet   = HoldemActionBet
    PineappleActionRaise = HoldemActionRaise
    PineappleActionAllIn = HoldemActionAllIn
)

リバイフェーズ種別定数 (Holdemと共通)

const (
    PineappleRebuyPhaseNone  = HoldemRebuyPhaseNone
    PineappleRebuyPhaseRebuy = HoldemRebuyPhaseRebuy
    PineappleRebuyPhaseAddon = HoldemRebuyPhaseAddon
)

ポーカーゲームのフェーズ定数

const (
    PokerPhaseInit      = 0 // 初期状態
    PokerPhaseDeal      = 1 // カード配布後 (第1ベッティングラウンド)
    PokerPhaseExchange  = 2 // カード交換フェーズ
    PokerPhaseSecondBet = 3 // 第2ベッティングラウンド
    PokerPhaseEnd       = 4 // ゲーム終了
)

アクション定数 (共通定数のエイリアス)

const (
    PokerActionFold  = bettingActionFold  // フォールド
    PokerActionCheck = bettingActionCheck // チェック
    PokerActionCall  = bettingActionCall  // コール
    PokerActionBet   = bettingActionBet   // ベット
    PokerActionRaise = bettingActionRaise // レイズ
    PokerActionAllIn = bettingActionAllIn // オールイン
)

PokerCpuCountMin PokerCpuCountMax CPU プレイヤー数の有効範囲

const (
    PokerCpuCountMin = 1 // CPU プレイヤー最小数
    PokerCpuCountMax = 3 // CPU プレイヤー最大数
)

ポーカーハンドランク定数

const (
    PokerHandHighCard      = 0
    PokerHandOnePair       = 1
    PokerHandTwoPair       = 2
    PokerHandThreeOfAKind  = 3
    PokerHandStraight      = 4
    PokerHandFlush         = 5
    PokerHandFullHouse     = 6
    PokerHandFourOfAKind   = 7
    PokerHandStraightFlush = 8
    PokerHandRoyalFlush    = 9
    PokerHandFiveOfAKind   = 10
)

フェーズ定数

const (
    SevenCardStudPhaseInit          = 0 // 初期状態
    SevenCardStudPhaseThirdStreet   = 1 // サードストリート (2 down + 1 up + betting)
    SevenCardStudPhaseFourthStreet  = 2 // フォースストリート (1 up + betting)
    SevenCardStudPhaseFifthStreet   = 3 // フィフスストリート (1 up + betting)
    SevenCardStudPhaseSixthStreet   = 4 // シックススストリート (1 up + betting)
    SevenCardStudPhaseSeventhStreet = 5 // セブンスストリート (1 down + betting)
    SevenCardStudPhaseShowdown      = 6 // ショーダウン
    SevenCardStudPhaseEnd           = 7 // ゲーム終了
    SevenCardStudPhaseRebuy         = 8 // リバイ/アドオン待ち
)

アクション定数 (共通定数のエイリアス)

const (
    SevenCardStudActionFold  = bettingActionFold
    SevenCardStudActionCheck = bettingActionCheck
    SevenCardStudActionCall  = bettingActionCall
    SevenCardStudActionBet   = bettingActionBet
    SevenCardStudActionRaise = bettingActionRaise
    SevenCardStudActionAllIn = bettingActionAllIn
)

リバイフェーズ種別定数

const (
    SevenCardStudRebuyPhaseNone  = 0
    SevenCardStudRebuyPhaseRebuy = 1
    SevenCardStudRebuyPhaseAddon = 2
)

テーブルサイズ定数

const (
    SevenCardStudTableSize4 = 4 // 4-max (1 human + 3 CPU)
    SevenCardStudTableSize6 = 6 // 6-max (1 human + 5 CPU)
    SevenCardStudTableSize7 = 7 // 7-max (1 human + 6 CPU)
)

CPU戦略モード定数

const (
    SevensCpuSimple     int = iota // シンプル (最初の出せるカード)
    SevensCpuStrategic             // 戦略的 (自己利益重視)
    SevensCpuHarassment            // 嫌がらせ特化 (相手妨害重視)
)

ショートデックフェーズ定数 (Holdemと共通)

const (
    ShortDeckPhaseInit     = HoldemPhaseInit
    ShortDeckPhasePreFlop  = HoldemPhasePreFlop
    ShortDeckPhaseFlop     = HoldemPhaseFlop
    ShortDeckPhaseTurn     = HoldemPhaseTurn
    ShortDeckPhaseRiver    = HoldemPhaseRiver
    ShortDeckPhaseShowdown = HoldemPhaseShowdown
    ShortDeckPhaseEnd      = HoldemPhaseEnd
    ShortDeckPhaseRebuy    = HoldemPhaseRebuy
)

ショートデックアクション定数 (Holdemと共通)

const (
    ShortDeckActionFold  = HoldemActionFold
    ShortDeckActionCheck = HoldemActionCheck
    ShortDeckActionCall  = HoldemActionCall
    ShortDeckActionBet   = HoldemActionBet
    ShortDeckActionRaise = HoldemActionRaise
    ShortDeckActionAllIn = HoldemActionAllIn
)

リバイフェーズ種別定数 (Holdemと共通)

const (
    ShortDeckRebuyPhaseNone  = HoldemRebuyPhaseNone
    ShortDeckRebuyPhaseRebuy = HoldemRebuyPhaseRebuy
    ShortDeckRebuyPhaseAddon = HoldemRebuyPhaseAddon
)

スリーカードポーカーフェーズ定数

const (
    ThreeCardPhaseBet    = 1 // ベットフェーズ
    ThreeCardPhaseAction = 2 // アクションフェーズ(Play/Fold選択)
    ThreeCardPhaseEnd    = 3 // 終了フェーズ
)

スリーカードポーカーデフォルト値

const (
    ThreeCardDefaultChips = 1000  // デフォルトチップ
    ThreeCardMinBet       = 10    // 最低ベット額
    ThreeCardMaxBet       = 10000 // 最大ベット額
    ThreeCardHandSize     = 3     // ハンドサイズ
)

アンテボーナス配当倍率

const (
    ThreeCardAnteBonusStraightFlush = 5 // ストレートフラッシュ 5:1
    ThreeCardAnteBonusThreeOfAKind  = 4 // スリーカード 4:1
    ThreeCardAnteBonusStraight      = 1 // ストレート 1:1
)

ペアプラス配当倍率

const (
    ThreeCardPairPlusStraightFlush = 40 // ストレートフラッシュ 40:1
    ThreeCardPairPlusThreeOfAKind  = 30 // スリーカード 30:1
    ThreeCardPairPlusStraight      = 6  // ストレート 6:1
    ThreeCardPairPlusFlush         = 3  // フラッシュ 3:1
    ThreeCardPairPlusPair          = 1  // ペア 1:1
)

ビデオポーカーフェーズ定数

const (
    VideoPokerPhaseBet    = 1 // ベットフェーズ
    VideoPokerPhaseDraw   = 2 // ドローフェーズ(ホールド選択)
    VideoPokerPhaseResult = 3 // 結果フェーズ
)

ビデオポーカーデフォルト値

const (
    VideoPokerDefaultChips = 1000 // デフォルトチップ
    VideoPokerMinBet       = 1    // 最低ベット(コイン)
    VideoPokerMaxBet       = 5    // 最大ベット(コイン)
    VideoPokerHandSize     = 5    // ハンドサイズ
)

3-card poker hand rank constants (descending order). Note: In 3-card poker, Three of a Kind ranks ABOVE Straight.

const (
    ThreeCardHandHighCard      = 1
    ThreeCardHandPair          = 2
    ThreeCardHandFlush         = 3
    ThreeCardHandStraight      = 4
    ThreeCardHandThreeOfAKind  = 5
    ThreeCardHandStraightFlush = 6
)

ショートデックハンドランク定数 (Flush > FullHouse)

const (
    ShortDeckHandHighCard      = 0
    ShortDeckHandOnePair       = 1
    ShortDeckHandTwoPair       = 2
    ShortDeckHandThreeOfAKind  = 3
    ShortDeckHandStraight      = 4
    ShortDeckHandFullHouse     = 5
    ShortDeckHandFlush         = 6
    ShortDeckHandFourOfAKind   = 7
    ShortDeckHandStraightFlush = 8
    ShortDeckHandRoyalFlush    = 9
)

BJCpuBetAmount CPU自動ベット額

const BJCpuBetAmount = 50

BJMaxCpuPlayers CPUプレイヤー最大数

const BJMaxCpuPlayers = 3

BacPairPayoutRate バカラペア配当倍率

const BacPairPayoutRate = 11

BridgeHandSize 各プレイヤーの手札枚数

const BridgeHandSize = 13

BridgePlayerCnt ブリッジプレイヤー数

const BridgePlayerCnt = 4

BridgeSuitNoTrump ノートランプを表すスート値

const BridgeSuitNoTrump = 0

BridgeTeamCnt チーム数

const BridgeTeamCnt = 2

BridgeTotalTricks 1ラウンドの総トリック数

const BridgeTotalTricks = 13

CanastaDefaultPointLimit デフォルトの目標スコア

const CanastaDefaultPointLimit = 5000

CanastaHandSize 初期配布枚数 (2人制カナスタ)

const CanastaHandSize = 15

CanastaPlayerCnt カナスタプレイヤー数

const CanastaPlayerCnt = 2

ClockSolitaireCardsPerPile 各パイルのカード枚数

const ClockSolitaireCardsPerPile = 4

ClockSolitaireKingPileIdx 中央(K)パイルのインデックス

const ClockSolitaireKingPileIdx = 12

ClockSolitairePileCount パイル数(時計の12位置+中央)

const ClockSolitairePileCount = 13

CrazyEightsHandSize 初期配布枚数

const CrazyEightsHandSize = 5

CrazyEightsPlayerCnt クレイジーエイトプレイヤー数

const CrazyEightsPlayerCnt = 4

CrazyEightsWildValue ワイルドカード値 (8)

const CrazyEightsWildValue = 8

CribbageDealSize 初期配布枚数

const CribbageDealSize = 6

CribbageDefaultPointLimit デフォルトのゲーム終了スコア

const CribbageDefaultPointLimit = 121

CribbageDiscardSize クリブに捨てる枚数

const CribbageDiscardSize = 2

CribbageHandSize ディスカード後の手札枚数

const CribbageHandSize = 4

CribbagePegLimit ペギングの上限値

const CribbagePegLimit = 31

CribbagePlayerCnt クリベッジプレイヤー数

const CribbagePlayerCnt = 2

DaifugoFiveSkipCountMax 5飛びスキップ数最大

const DaifugoFiveSkipCountMax = 5

DaifugoJokerCount 大富豪で使用するジョーカー枚数

const DaifugoJokerCount = 2

DaifugoJokerStrength ジョーカーの強さ (常に最強)

const DaifugoJokerStrength = 16

DaifugoPlayerCnt 大富豪プレイヤー数

const DaifugoPlayerCnt = 4

DaifugoSolverMaxCards is the maximum hand size for triggering the endgame solver. When the CPU (Hard difficulty) has at most this many cards, the solver attempts to find a guaranteed winning play sequence.

const DaifugoSolverMaxCards = 8

DoubtPlayerCnt ダウトプレイヤー数

const DoubtPlayerCnt = 4

EuchreHandSize 各プレイヤーの手札枚数

const EuchreHandSize = 5

EuchreKittySize キティ枚数

const EuchreKittySize = 4

EuchrePlayerCnt ユーカープレイヤー数

const EuchrePlayerCnt = 4

EuchreTeamCnt チーム数

const EuchreTeamCnt = 2

FreeCellCellCnt フリーセルの数

const FreeCellCellCnt = 4

FreeCellFoundationCnt ファンデーションの数

const FreeCellFoundationCnt = 4

FreeCellSolverMaxIterations is the maximum number of states the solver explores. Keeps runtime under ~50ms and memory under ~10MB.

const FreeCellSolverMaxIterations = 100000

FreeCellTableauCnt タブローの列数

const FreeCellTableauCnt = 8

GinRummyBigGinBonus ビッグジンボーナス点

const GinRummyBigGinBonus = 31

GinRummyGinBonus ジンボーナス点

const GinRummyGinBonus = 25

GinRummyHandSize 初期配布枚数

const GinRummyHandSize = 10

GinRummyKnockThreshold ノック可能なデッドウッド上限

const GinRummyKnockThreshold = 10

GinRummyPlayerCnt ジンラミープレイヤー数

const GinRummyPlayerCnt = 2

GinRummyUndercutBonus アンダーカットボーナス点

const GinRummyUndercutBonus = 25

GoFishBookSize ブック完成に必要な同ランク枚数

const GoFishBookSize = 4

GoFishInitialHandSize 初期手札枚数 (4人以上は5枚)

const GoFishInitialHandSize = 5

GoFishPlayerCnt Go Fishプレイヤー数

const GoFishPlayerCnt = 4

GoFishTotalBooks ブック総数 (A-K の13種)

const GoFishTotalBooks = 13

GolfColCnt ゴルフの列数

const GolfColCnt = 7

GolfRowCnt ゴルフの段数

const GolfRowCnt = 5

GolfTableauCnt タブロー上のカード枚数 (7*5)

const GolfTableauCnt = 35

HeartsHandSize 各プレイヤーの手札枚数

const HeartsHandSize = 13

HeartsMaxPoints シュート・ザ・ムーン時のペナルティ合計

const HeartsMaxPoints = 26

HeartsPassCardCount パスで渡すカード枚数

const HeartsPassCardCount = 3

HeartsPlayerCnt ハーツプレイヤー数

const HeartsPlayerCnt = 4

KlondikeFoundationCnt ファンデーションの数

const KlondikeFoundationCnt = 4

KlondikeTableauCnt タブローの列数

const KlondikeTableauCnt = 7

MaxClaimedValue claimed value の最大値 (K)

const MaxClaimedValue = 13

MemoryBoardSize ボードのカード枚数 (52枚)

const MemoryBoardSize = 52

MemoryPlayerCnt 神経衰弱のプレイヤー数

const MemoryPlayerCnt = 4

MinClaimedValue claimed value の最小値 (A)

const MinClaimedValue = 1

NapoleonHandSize 各プレイヤーの手札枚数

const NapoleonHandSize = 13

NapoleonMaxPictureCards 絵札の最大枚数 (J,Q,K,A × 4スート + Joker = 17)

const NapoleonMaxPictureCards = 17

NapoleonPlayerCnt ナポレオンプレイヤー数

const NapoleonPlayerCnt = 4

NapoleonTotalCards デッキ総枚数 (52 + Joker 1)

const NapoleonTotalCards = 53

OhHellPlayerCnt オー・ヘルプレイヤー数

const OhHellPlayerCnt = 4

OldMaidPlayerCnt ババ抜きプレイヤー数

const OldMaidPlayerCnt = 4

PigsTailPlayerCnt ぶたのしっぽデフォルトプレイヤー数

const PigsTailPlayerCnt = 4

PinochleHandSize 各プレイヤーの手札枚数

const PinochleHandSize = 12

PinochleLastTrickBonus 最終トリックボーナス

const PinochleLastTrickBonus = 10

PinochleMinBid 最低ビッド

const PinochleMinBid = 20

PinochlePlayerCnt ピノクルプレイヤー数

const PinochlePlayerCnt = 4

PinochleTeamCnt チーム数

const PinochleTeamCnt = 2

PinochleTotalCardPoints ラウンドあたりの合計カードポイント (最終トリックボーナス含む)

const PinochleTotalCardPoints = 250

PokerJokerCountMax ジョーカー枚数最大

const PokerJokerCountMax = 2

PyramidCardCnt ピラミッドのカード枚数 (1+2+3+4+5+6+7)

const PyramidCardCnt = 28

PyramidRowCnt ピラミッドの段数

const PyramidRowCnt = 7

PyramidTargetSum ペア除去の合計値

const PyramidTargetSum = 13

SevensMaxJokerCount 7並べで許可されるジョーカー最大枚数

const SevensMaxJokerCount = 2

SevensMaxPasses 7並べで各プレイヤーに許可されるパス回数

const SevensMaxPasses = 5

SevensPlayerCnt 7並べプレイヤー数

const SevensPlayerCnt = 4

SpadesHandSize 各プレイヤーの手札枚数

const SpadesHandSize = 13

SpadesLoseThreshold 負け閾値 (-200点以下で負け)

const SpadesLoseThreshold = -200

SpadesPlayerCnt スペードプレイヤー数

const SpadesPlayerCnt = 4

SpeedCenterPileCnt 台札の数

const SpeedCenterPileCnt = 2

SpeedHandSize 手札の最大枚数

const SpeedHandSize = 4

SpeedPlayerCnt プレイヤー数 (human + CPU)

const SpeedPlayerCnt = 2

SpiderFoundationCnt ファンデーションの数(完成スート数)

const SpiderFoundationCnt = 8

SpiderTableauCnt タブローの列数

const SpiderTableauCnt = 10

SpiderTotalCards 総カード数(2デッキ)

const SpiderTotalCards = 104

TriPeaksColCnt トリピークスの最大列数

const TriPeaksColCnt = 10

TriPeaksRowCnt トリピークスの段数

const TriPeaksRowCnt = 4

TriPeaksTableauCnt タブロー上のカード枚数 (3+6+9+10)

const TriPeaksTableauCnt = 28

Variables

GoFish固有エラー

var (
    ErrGoFishNotYourTurn   = errors.New("not your turn")
    ErrGoFishInvalidTarget = errors.New("invalid target player")
    ErrGoFishInvalidRank   = errors.New("you do not hold that rank")
    ErrGoFishGameEnded     = errors.New("game has ended")
    ErrGoFishAskSelf       = errors.New("cannot ask yourself")
)

Sentinel errors for domain-layer validation failures.

var (
    // ErrWrongPhase indicates an action was attempted in the wrong game phase.
    ErrWrongPhase = errors.New("wrong game phase")
    // ErrInvalidAmount indicates a bet or raise amount is out of range.
    ErrInvalidAmount = errors.New("invalid amount")
    // ErrInsufficientChips indicates the player lacks chips for the action.
    ErrInsufficientChips = errors.New("insufficient chips")
    // ErrGameEnded indicates the game has already finished.
    ErrGameEnded = errors.New("game has ended")
    // ErrNotHumanTurn indicates it is not the human player's turn.
    ErrNotHumanTurn = errors.New("not human player's turn")
    // ErrInvalidCard indicates the selected card index is out of range or invalid.
    ErrInvalidCard = errors.New("invalid card")
    // ErrInvalidPlay indicates the attempted play violates game rules.
    ErrInvalidPlay = errors.New("invalid play")
    // ErrDeckExhausted indicates the deck has no more cards to draw.
    ErrDeckExhausted = errors.New("deck exhausted")
    // ErrCannotPass indicates the player is not allowed to pass.
    ErrCannotPass = errors.New("cannot pass")
    // ErrHandFinished indicates the hand has already been resolved.
    ErrHandFinished = errors.New("hand already finished")
    // ErrInvalidIndices indicates the provided index permutation is invalid.
    ErrInvalidIndices = errors.New("invalid indices")
)

BJValidDeckCounts 有効なデッキ数

var BJValidDeckCounts = []int{1, 2, 4, 6, 8}

BJValidPenetrations 有効なペネトレーション値

var BJValidPenetrations = []int{50, 75}

BettingLimitNames リミットタイプ名

var BettingLimitNames = []string{
    "Fixed",
    "Pot Limit",
    "No Limit",
}

DaifugoDifficultyNames 難易度名マップ

var DaifugoDifficultyNames = map[DaifugoCpuDifficulty]string{
    DaifugoDifficultyNormal: "Normal",
    DaifugoDifficultyEasy:   "Easy",
    DaifugoDifficultyHard:   "Hard",
}

HoldemPlayStyleNames プレイスタイル名

var HoldemPlayStyleNames = []string{
    "TAG",
    "LAP",
    "TAP",
    "LAG",
    "GTO",
}

PokerHandNames ポーカーハンド名

var PokerHandNames = []string{
    "High Card",
    "One Pair",
    "Two Pair",
    "Three of a Kind",
    "Straight",
    "Flush",
    "Full House",
    "Four of a Kind",
    "Straight Flush",
    "Royal Flush",
    "Five of a Kind",
}

PokerPlayStyleNames プレイスタイル名

var PokerPlayStyleNames = []string{
    "Conservative",
    "Balanced",
    "Aggressive",
    "Bluffer",
}

SevenCardStudPlayStyleNames プレイスタイル名 (Holdemと共通)

var SevenCardStudPlayStyleNames = HoldemPlayStyleNames

ShortDeckHandNames ショートデックハンド名

var ShortDeckHandNames = []string{
    "High Card",
    "One Pair",
    "Two Pair",
    "Three of a Kind",
    "Straight",
    "Full House",
    "Flush",
    "Four of a Kind",
    "Straight Flush",
    "Royal Flush",
}

ShortDeckValues ショートデックで使用するカード値 (A,6,7,8,9,10,J,Q,K)

var ShortDeckValues = []int{1, 6, 7, 8, 9, 10, 11, 12, 13}

ThreeCardHandNames maps 3-card hand ranks to display names.

var ThreeCardHandNames = []string{
    "",
    "High Card",
    "Pair",
    "Flush",
    "Straight",
    "Three of a Kind",
    "Straight Flush",
}

## func BacPairPayout

func BacPairPayout(resultType int) int

BacPairPayout ペア結果に応じた配当倍率を返す

## func CalcDeadwoodValue

func CalcDeadwoodValue(deadwood []*Card) int

CalcDeadwoodValue デッドウッドの合計点数を計算する

## func CalcPotOdds

func CalcPotOdds(pot, callAmount int) float64

CalcPotOdds ポットオッズを計算 (パーセンテージ 0-100)

## func CalculateBettingLimits

func CalculateBettingLimits(limit BettingLimitType, pot, lastBet int) (maxRaises, maxBetAmount int)

CalculateBettingLimits ベッティングリミット設定からmaxRaisesとmaxBetAmountを計算

## func CalculateBlackJackScore

func CalculateBlackJackScore(cards []*Card) int

CalculateBlackJackScore カードスライスからブラックジャックスコアを計算する共通関数

## func CanastaCardValue

func CanastaCardValue(card *Card) int

CanastaCardValue カードの点数を返す

## func CanastaIsBlack3

func CanastaIsBlack3(card *Card) bool

CanastaIsBlack3 黒3かどうか (スペード3またはクローバー3)

## func CanastaIsRed3

func CanastaIsRed3(card *Card) bool

CanastaIsRed3 赤3かどうか (ハート3またはダイヤ3)

## func CanastaIsWild

func CanastaIsWild(card *Card) bool

CanastaIsWild ワイルドカードかどうか (ジョーカーまたは2)

## func CardValueDisplayName

func CardValueDisplayName(value int) string

CardValueDisplayName converts a card value (1-13) to its display label.

## func CompareVisibleHands

func CompareVisibleHands(a, b *SevenCardStudPlayer) int

CompareVisibleHands 2人のプレイヤーの表向き札を比較する (a > b: 1, a < b: -1, a == b: 0)

## func CpuCallOrCheck

func CpuCallOrCheck(callAmount int) (int, int)

CpuCallOrCheck コール額がある場合はコール、なければチェック

## func CpuFoldOrCheck

func CpuFoldOrCheck(callAmount int) (int, int)

CpuFoldOrCheck コール額がある場合はフォールド、なければチェック

## func CpuRaiseOrBet

func CpuRaiseOrBet(chips, callAmount, raiseAmt int) (int, int)

CpuRaiseOrBet レイズまたはベット (チップ不足時はオールイン)

## func CribbageScoreFifteens

func CribbageScoreFifteens(cards []*Card) int

CribbageScoreFifteens 15になる組み合わせを数える (各2点)

## func CribbageScoreFlush

func CribbageScoreFlush(hand []*Card, starter *Card, isCrib bool) int

CribbageScoreFlush フラッシュのスコアを返す hand の4枚が同一スートなら4点、starter も同じなら5点 crib の場合は5枚全て同一スートでないと0点

## func CribbageScoreNobs

func CribbageScoreNobs(hand []*Card, starter *Card) int

CribbageScoreNobs ノブのスコアを返す (手札のJがstarterのスートと一致 → 1点)

## func CribbageScorePairs

func CribbageScorePairs(cards []*Card) int

CribbageScorePairs 同じランクのペアを数える (各2点)

## func CribbageScorePegging

func CribbageScorePegging(playedCards []*Card, pegCount int) int

CribbageScorePegging ペギングのスコアを計算する playedCards は現在のペギングシーケンスで最後に追加されたカードがスコア対象

## func CribbageScoreRuns

func CribbageScoreRuns(cards []*Card) int

CribbageScoreRuns ランを検出してスコアを返す ランクの連続3枚以上がランとなる。重複ランクがある場合は掛け算 (ダブルラン等)

## func DaifugoCardStrength

func DaifugoCardStrength(v int) int

DaifugoCardStrength カードの強さを返す (3が最弱、2が最強) 3 < 4 < 5 < 6 < 7 < 8 < 9 < 10 < J(11) < Q(12) < K(13) < A(1) < 2(2)

## func DaifugoCardStrengthRevolution

func DaifugoCardStrengthRevolution(v int) int

DaifugoCardStrengthRevolution 革命中のカードの強さを返す (2が最弱、3が最強) 2 < A(1) < K(13) < Q(12) < J(11) < 10 < 9 < 8 < 7 < 6 < 5 < 4 < 3

## func DecayMemories

func DecayMemories[T MemoryEntry](memories []T, currentTurn int, decayRate float64) []T

DecayMemories 古い記憶を確率的に忘却する共通関数 忘却確率 = decayRate * (currentTurn - entry.GetTurnSeen())

## func DistributePots

func DistributePots(players []BettingPlayer, sidePots []SidePot) map[int]int

DistributePots サイドポットの勝者配分を計算しチップを付与

## func DistributePotsWithWinnerFunc

func DistributePotsWithWinnerFunc(players []BettingPlayer, sidePots []SidePot, winnerFunc WinnerFunc) map[int]int

DistributePotsWithWinnerFunc サイドポットの勝者配分を計算しチップを付与 (勝者判定関数を指定)

## func Evaluate21Plus3

func Evaluate21Plus3(card1, card2, dealerUpcard *Card) (resultType int, resultName string)

Evaluate21Plus3 プレイヤーの2枚+ディーラーのアップカードで21+3を判定

## func EvaluateBaccaratPair

func EvaluateBaccaratPair(card1, card2 *Card) (int, string)

EvaluateBaccaratPair 2枚のカードがペアかを判定する

## func EvaluatePerfectPairs

func EvaluatePerfectPairs(card1, card2 *Card) (resultType int, resultName string)

EvaluatePerfectPairs プレイヤーの最初の2枚でPerfect Pairsを判定

## func ExecuteBettingAction

func ExecuteBettingAction(players []BettingPlayer, state *BettingState, playerIdx, action, amount, minBetAmount, maxRaises, maxBetAmount int) error

ExecuteBettingAction 共通ベッティングアクション実行 maxRaises: 最大レイズ回数 (0以下で無制限=NoLimit) maxBetAmount: 最大ベット額 (0以下で無制限)

## func ExtractKickers

func ExtractKickers(cards []*Card, handRank int) []int

ExtractKickers extracts kicker card values from a 5-card hand. Returns nil for hands where kickers are not applicable (HighCard, Straight, Flush, FullHouse, StraightFlush, RoyalFlush, FiveOfAKind). For pair-based hands, returns the non-pair card values sorted descending (Ace=14).

## func FindPotWinners

func FindPotWinners(players []BettingPlayer, eligible []int) []int

FindPotWinners 対象プレイヤーから最強ハンドのプレイヤーを返す (複数ならスプリット)

## func FindPotWinnersLowball

func FindPotWinnersLowball(players []BettingPlayer, eligible []int) []int

FindPotWinnersLowball 対象プレイヤーから最弱ハンドのプレイヤーを返す (2-7 Lowball: 低い手が勝ち) ランクが低いほど強い。同ランク時はカード値が低い方が勝つ (Ace=14 always)

## func FormatKickers

func FormatKickers(kickers []int) string

FormatKickers formats kicker values as a display string (e.g., “A, Q, 10”).

## func GetCountingBetAmount

func GetCountingBetAmount(trueCount float64, runningCount int, system int, availableChips int) int

GetCountingBetAmount カウンティングに基づくCPUベット額を計算する ベーススプレッド: count<=1→1x, 2→2x, 3→4x, 4→8x, >=5→16x (base=BJCpuBetAmount)

## func GinRummyCardValue

func GinRummyCardValue(card *Card) int

GinRummyCardValue カードの点数を返す (A=1, 2-9=face value, 10/J/Q/K=10)

## func IsBalancedCountingSystem

func IsBalancedCountingSystem(system int) bool

IsBalancedCountingSystem バランスドカウンティングシステムか (TC計算可能)

## func IsJoker

func IsJoker(card *Card) bool

IsJoker カードがジョーカーかどうか判定

## func IsValidHoldemTableSize

func IsValidHoldemTableSize(n int) bool

IsValidHoldemTableSize テーブルサイズが有効か判定する

## func IsValidSevenCardStudTableSize

func IsValidSevenCardStudTableSize(n int) bool

IsValidSevenCardStudTableSize テーブルサイズが有効か判定する

## func PerfectPairsPayout

func PerfectPairsPayout(resultType int) int

PerfectPairsPayout Perfect Pairsの配当倍率を返す

## func ResetActedExcept

func ResetActedExcept(players []BettingPlayer, actedFlags []bool, exceptIdx int)

ResetActedExcept 指定プレイヤー以外のactedフラグをリセット (フォールド・オールイン除く)

## func ShouldTakeInsurance

func ShouldTakeInsurance(trueCount float64, runningCount int, system int) bool

ShouldTakeInsurance カウンティングに基づきインシュランスを取るべきか判定する count >= 3 でインシュランスを取る

## func SuitRank

func SuitRank(design int) int

SuitRank ブリングイン決定用のスートランキング (低い方がブリングイン) スペード=4(最高), ハート=3, ダイヤ=2, クラブ=1(最低)

## func TwentyOnePlus3Payout

func TwentyOnePlus3Payout(resultType int) int

TwentyOnePlus3Payout 21+3の配当倍率を返す

## func ValidateMin

func ValidateMin(name string, value, min int) error

ValidateMin は値が min 以上であることを検証する。

## func ValidateRange

func ValidateRange(name string, value, min, max int) error

ValidateRange は値が [min, max] の範囲内であることを検証する。

## type ActionLogEntry

ActionLogEntry 棋譜エントリ

type ActionLogEntry struct {
    TurnNumber int     // ターン番号
    PlayerIdx  int     // プレイヤーインデックス (-1 = システム/ディーラー)
    ActionType string  // アクション種別 (ゲーム固有)
    Detail     string  // 人間が読める説明
    Cards      []*Card // 関連カード (常に公開)
}

### func (*ActionLogEntry) MarshalJSON

func (e *ActionLogEntry) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*ActionLogEntry) UnmarshalJSON

func (e *ActionLogEntry) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type BJSideBetResult

BJSideBetResult サイドベット結果

type BJSideBetResult struct {
    BetType    int    `json:"bt"`
    ResultType int    `json:"rt"`
    ResultName string `json:"rn"`
    BetAmount  int    `json:"ba"`
    Payout     int    `json:"po"`
}

### func (*BJSideBetResult) BetTypeName

func (r *BJSideBetResult) BetTypeName() string

BetTypeName ベット種別名を返す

## type BJSuggestedAction

BJSuggestedAction ベーシックストラテジー推奨アクション

type BJSuggestedAction int

BJSuggestedAction定数

const (
    // BJSuggestNone 推奨なし
    BJSuggestNone BJSuggestedAction = 0
    // BJSuggestHit ヒット推奨
    BJSuggestHit BJSuggestedAction = 1
    // BJSuggestStand スタンド推奨
    BJSuggestStand BJSuggestedAction = 2
    // BJSuggestDouble ダブルダウン推奨
    BJSuggestDouble BJSuggestedAction = 3
    // BJSuggestSplit スプリット推奨
    BJSuggestSplit BJSuggestedAction = 4
    // BJSuggestSurrender サレンダー推奨
    BJSuggestSurrender BJSuggestedAction = 5
    // BJSuggestDeclineInsurance インシュランス辞退推奨
    BJSuggestDeclineInsurance BJSuggestedAction = 6
    // BJSuggestDoubleStand ダブルダウン推奨(不可ならスタンド)
    BJSuggestDoubleStand BJSuggestedAction = 7
)

### func GetBasicStrategyAction

func GetBasicStrategyAction(hand *BlackJackHand, dealerUpcard *Card, dealerHitsSoft17 bool) BJSuggestedAction

GetBasicStrategyAction ベーシックストラテジーによる推奨アクションを返す (standard multi-deck, S17 or H17) H=Hit, S=Stand, D=Double(else Hit), Ds=Double(else Stand), Sp=Split, Rh=Surrender(else Hit)

## type BacSideBetResult

BacSideBetResult バカラサイドベット結果

type BacSideBetResult struct {
    BetType    int    `json:"bt"`
    ResultType int    `json:"rt"`
    ResultName string `json:"rn"`
    BetAmount  int    `json:"ba"`
    Payout     int    `json:"po"`
}

### func (*BacSideBetResult) BetTypeName

func (r *BacSideBetResult) BetTypeName() string

BetTypeName ベット種別名を返す

## type Baccarat

Baccarat バカラクラス

type Baccarat struct {
    // contains filtered or unexported fields
}

### func NewBaccarat

func NewBaccarat(trumpCards *TrumpCards) *Baccarat

NewBaccarat コンストラクタ

### func NewDefaultBaccarat

func NewDefaultBaccarat() *Baccarat

NewDefaultBaccarat デフォルト設定のバカラを生成するファクトリ関数

### func (*Baccarat) Bet

func (b *Baccarat) Bet(amount, betType, ppBet, bpBet int) error

Bet ベット&ゲーム実行(バカラはベット後に全自動進行)

### func (*Baccarat) CalculateHandValue

func (b *Baccarat) CalculateHandValue(cards []*Card) int

CalculateHandValue ハンドの合計値を計算(mod 10)

### func (*Baccarat) ClearHistory

func (b *Baccarat) ClearHistory()

ClearHistory 罫線履歴をクリアする

### func (*Baccarat) GetActionLog

func (b *Baccarat) GetActionLog() []*ActionLogEntry

GetActionLog 棋譜を取得する

### func (*Baccarat) GetBankerHand

func (b *Baccarat) GetBankerHand() []*Card

GetBankerHand バンカーハンド取得

### func (*Baccarat) GetBankerHandValue

func (b *Baccarat) GetBankerHandValue() int

GetBankerHandValue バンカーハンド合計値

### func (*Baccarat) GetBankerPairBet

func (b *Baccarat) GetBankerPairBet() int

GetBankerPairBet バンカーペアベット額を取得する

### func (*Baccarat) GetBetAmount

func (b *Baccarat) GetBetAmount() int

GetBetAmount ベット額

### func (*Baccarat) GetBetType

func (b *Baccarat) GetBetType() int

GetBetType ベットタイプ

### func (*Baccarat) GetChips

func (b *Baccarat) GetChips() int

GetChips チップ

### func (*Baccarat) GetGameEndFlag

func (b *Baccarat) GetGameEndFlag() bool

GetGameEndFlag ゲーム終了フラグ

### func (*Baccarat) GetHistory

func (b *Baccarat) GetHistory() []int

GetHistory 罫線履歴を取得する

### func (*Baccarat) GetPayout

func (b *Baccarat) GetPayout() int

GetPayout 配当金額

### func (*Baccarat) GetPhase

func (b *Baccarat) GetPhase() int

GetPhase 現在のフェーズ

### func (*Baccarat) GetPlayerHand

func (b *Baccarat) GetPlayerHand() []*Card

GetPlayerHand プレイヤーハンド取得

### func (*Baccarat) GetPlayerHandValue

func (b *Baccarat) GetPlayerHandValue() int

GetPlayerHandValue プレイヤーハンド合計値

### func (*Baccarat) GetPlayerPairBet

func (b *Baccarat) GetPlayerPairBet() int

GetPlayerPairBet プレイヤーペアベット額を取得する

### func (*Baccarat) GetResult

func (b *Baccarat) GetResult() GameResult

GetResult ゲーム結果

### func (*Baccarat) GetSideBetResults

func (b *Baccarat) GetSideBetResults() []*BacSideBetResult

GetSideBetResults サイドベット結果を取得する

### func (*Baccarat) MarshalJSON

func (b *Baccarat) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*Baccarat) Reset

func (b *Baccarat) Reset()

Reset ゲーム初期化(履歴は保持)

### func (*Baccarat) SetBankerHand

func (b *Baccarat) SetBankerHand(cards []*Card)

SetBankerHand バンカーハンド設定(テスト用)

### func (*Baccarat) SetBankerPairBet

func (b *Baccarat) SetBankerPairBet(amount int)

SetBankerPairBet バンカーペアベット額設定(テスト用)

### func (*Baccarat) SetBetAmount

func (b *Baccarat) SetBetAmount(amount int)

SetBetAmount ベット額設定(テスト用)

### func (*Baccarat) SetBetType

func (b *Baccarat) SetBetType(betType int)

SetBetType ベットタイプ設定(テスト用)

### func (*Baccarat) SetChips

func (b *Baccarat) SetChips(chips int)

SetChips チップ設定(テスト用)

### func (*Baccarat) SetGameEndFlag

func (b *Baccarat) SetGameEndFlag(flag bool)

SetGameEndFlag ゲーム終了フラグ設定(テスト用)

### func (*Baccarat) SetHistory

func (b *Baccarat) SetHistory(history []int)

SetHistory 罫線履歴設定(テスト用)

### func (*Baccarat) SetPhase

func (b *Baccarat) SetPhase(phase int)

SetPhase フェーズ設定(テスト用)

### func (*Baccarat) SetPlayerHand

func (b *Baccarat) SetPlayerHand(cards []*Card)

SetPlayerHand プレイヤーハンド設定(テスト用)

### func (*Baccarat) SetPlayerPairBet

func (b *Baccarat) SetPlayerPairBet(amount int)

SetPlayerPairBet プレイヤーペアベット額設定(テスト用)

### func (*Baccarat) SetResult

func (b *Baccarat) SetResult(result GameResult)

SetResult ゲーム結果設定(テスト用)

### func (*Baccarat) UnmarshalJSON

func (b *Baccarat) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type BettingHumanProfile

BettingHumanProfile セッション内でベッティングゲーム(Poker/Holdem)における人間プレイヤーの行動を学習するプロファイル

type BettingHumanProfile struct {
    // AggressiveByBracket ハンド強度ブラケット別のアグレッシブ行動追跡:
    // [0]=弱(HighCard), [1]=中(OnePair/TwoPair), [2]=強(ThreeOfAKind+)
    AggressiveByBracket [3]struct{ Aggressive, Total int }
    // FoldToBetCount ベット/レイズに対してフォールドした回数
    FoldToBetCount int
    // FoldToBetTotal ベット/レイズに対するフォールド機会の合計
    FoldToBetTotal int
    // GamesPlayed セッション内のゲーム数
    GamesPlayed int
    // HesitationCount 迷い時間の計測回数 (Welford's online algorithm)
    HesitationCount int
    // HesitationMean 迷い時間の平均 (ms)
    HesitationMean float64
    // HesitationM2 迷い時間の分散計算用 M2 (Welford's online algorithm)
    HesitationM2 float64
}

### func (*BettingHumanProfile) AdaptStrength

func (p *BettingHumanProfile) AdaptStrength() float64

AdaptStrength 適応強度を返す (0.0 ~ 0.2)

### func (*BettingHumanProfile) AdjustedBluffChance

func (p *BettingHumanProfile) AdjustedBluffChance(base float64) float64

AdjustedBluffChance 人間のフォールド率に基づいて調整済みブラフ確率を返す 人間がフォールドしやすい → CPUがブラフを増やす

### func (*BettingHumanProfile) AdjustedCallChance

func (p *BettingHumanProfile) AdjustedCallChance(base float64, bracket int, hesitationMs int) float64

AdjustedCallChance ブラフ率と迷い時間に基づいて調整済みコール確率を返す base: ベースコール確率, bracket: ハンド強度ブラケット, hesitationMs: 迷い時間(ms)

### func (*BettingHumanProfile) BluffRate

func (p *BettingHumanProfile) BluffRate(bracket int) float64

BluffRate 指定ブラケットのアグレッシブ率を返す (データなしの場合0.5)

### func (*BettingHumanProfile) Export

func (p *BettingHumanProfile) Export() BettingHumanProfileData

Export プロファイルデータをJSON永続化形式でエクスポートする

### func (*BettingHumanProfile) FoldRate

func (p *BettingHumanProfile) FoldRate() float64

FoldRate フォールド率を返す (データなしの場合0.5)

### func (*BettingHumanProfile) HesitationBoost

func (p *BettingHumanProfile) HesitationBoost(ms int) float64

HesitationBoost 指定msの迷い時間に対するコール確率ブーストを返す

### func (*BettingHumanProfile) HesitationStdDev

func (p *BettingHumanProfile) HesitationStdDev() float64

HesitationStdDev 迷い時間の標準偏差を返す (データ不足の場合0)

### func (*BettingHumanProfile) HesitationZScore

func (p *BettingHumanProfile) HesitationZScore(ms int) float64

HesitationZScore 指定msの迷い時間のz-scoreを返す (データ不足の場合0)

### func (*BettingHumanProfile) Import

func (p *BettingHumanProfile) Import(data BettingHumanProfileData)

Import JSON永続化形式のデータからプロファイルを復元する

### func (*BettingHumanProfile) RecordAction

func (p *BettingHumanProfile) RecordAction(handRank, action int)

RecordAction 人間のベッティングアクションを記録する handRank: PokerHand* 定数, action: bettingAction* 定数

### func (*BettingHumanProfile) RecordFoldToBet

func (p *BettingHumanProfile) RecordFoldToBet(folded bool)

RecordFoldToBet ベット/レイズに対するフォールド機会を記録する

### func (*BettingHumanProfile) RecordHesitation

func (p *BettingHumanProfile) RecordHesitation(ms int)

RecordHesitation 迷い時間(ms)を記録する (Welford’s online algorithm) ms <= 0 の場合は何もしない (CUI等で計測不可の場合)

## type BettingHumanProfileBracketData

BettingHumanProfileBracketData はブラケット別アグレッシブ行動のJSON出力形式

type BettingHumanProfileBracketData struct {
    Aggressive int `json:"aggressive"`
    Total      int `json:"total"`
}

## type BettingHumanProfileData

BettingHumanProfileData はBettingHumanProfileのJSON永続化形式

type BettingHumanProfileData struct {
    AggressiveByBracket [3]BettingHumanProfileBracketData `json:"aggressiveByBracket"`
    FoldToBetCount      int                               `json:"foldToBetCount"`
    FoldToBetTotal      int                               `json:"foldToBetTotal"`
    GamesPlayed         int                               `json:"gamesPlayed"`
    HesitationCount     int                               `json:"hesitationCount"`
    HesitationMean      float64                           `json:"hesitationMean"`
    HesitationM2        float64                           `json:"hesitationM2"`
}

### func ImportBettingHumanProfileJSON

func ImportBettingHumanProfileJSON(data []byte) (BettingHumanProfileData, error)

ImportBettingHumanProfileJSON JSONバイトからBettingHumanProfileDataをデコードする

## type BettingLimitType

BettingLimitType ベッティングリミットタイプ

type BettingLimitType int

BettingLimitType定数

const (
    // BettingLimitFixed 固定リミット (最大4回レイズ)
    BettingLimitFixed BettingLimitType = iota
    // BettingLimitPotLimit ポットリミット (ベット/レイズ ≤ ポット)
    BettingLimitPotLimit
    // BettingLimitNoLimit ノーリミット
    BettingLimitNoLimit
)

## type BettingPlayer

BettingPlayer ベッティングに必要なプレイヤー操作インターフェース

type BettingPlayer interface {
    GetChips() int
    SubtractChips(int) bool
    AddChips(int)
    GetCurrentBet() int
    SetCurrentBet(int)
    GetFolded() bool
    SetFolded(bool)
    GetAllIn() bool
    SetAllIn(bool)
    GetHandRank() int
    GetComparisonCards() []*Card
}

## type BettingState

BettingState ベッティング状態 (ポインタで渡して共有)

type BettingState struct {
    Pot        int
    LastBet    int
    MinRaise   int
    RaiseCount int
    ActedFlags []bool
}

## type BlackJack

BlackJack ブラックジャッククラス

type BlackJack struct {
    // contains filtered or unexported fields
}

### func NewBlackJack

func NewBlackJack(trumpCards *TrumpCards, player *BlackJackPlayer, dealer *BlackJackPlayer) *BlackJack

NewBlackJack コンストラクタ

### func NewDefaultBlackJack

func NewDefaultBlackJack() *BlackJack

NewDefaultBlackJack デフォルト設定のブラックジャックを生成するファクトリ関数

### func (*BlackJack) CanSurrenderCpuHand

func (b *BlackJack) CanSurrenderCpuHand(cpuIdx, handIdx int) bool

CanSurrenderCpuHand CPUハンドのサレンダー可否判定

### func (*BlackJack) CanSurrenderHand

func (b *BlackJack) CanSurrenderHand(handIdx int) bool

CanSurrenderHand プレイヤーハンドのサレンダー可否判定

### func (*BlackJack) DealerHit

func (b *BlackJack) DealerHit()

DealerHit ディーラーヒット

### func (*BlackJack) DealerStand

func (b *BlackJack) DealerStand()

DealerStand ディーラースタンド

### func (*BlackJack) GameJudgment

func (b *BlackJack) GameJudgment() GameResult

GameJudgment ゲーム勝敗判定(後方互換: ハンド0の結果を返す)

### func (*BlackJack) GameJudgmentForHand

func (b *BlackJack) GameJudgmentForHand(handIdx int) GameResult

GameJudgmentForHand 指定ハンドの勝敗判定

### func (*BlackJack) Get21Plus3Bet

func (b *BlackJack) Get21Plus3Bet() int

Get21Plus3Bet 21+3ベット額取得

### func (*BlackJack) GetActionLog

func (b *BlackJack) GetActionLog() []*ActionLogEntry

GetActionLog 棋譜を取得する

### func (*BlackJack) GetBasicStrategySuggestion

func (b *BlackJack) GetBasicStrategySuggestion() BJSuggestedAction

GetBasicStrategySuggestion ベーシックストラテジーによる推奨アクションを返す

### func (*BlackJack) GetConfig

func (b *BlackJack) GetConfig() BlackJackConfig

GetConfig ゲーム設定取得

### func (*BlackJack) GetCpuPlayers

func (b *BlackJack) GetCpuPlayers() []*BlackJackCpuSeat

GetCpuPlayers CPUプレイヤー一覧

### func (*BlackJack) GetCurrentHandIdx

func (b *BlackJack) GetCurrentHandIdx() int

GetCurrentHandIdx 現在操作中のハンドインデックス

### func (*BlackJack) GetDealer

func (b *BlackJack) GetDealer() *BlackJackPlayer

GetDealer ディーラー

### func (*BlackJack) GetDeckCount

func (b *BlackJack) GetDeckCount() int

GetDeckCount デッキ数取得

### func (*BlackJack) GetDeckPenetration

func (b *BlackJack) GetDeckPenetration() int

GetDeckPenetration デッキペネトレーション率取得

### func (*BlackJack) GetGameEndFlag

func (b *BlackJack) GetGameEndFlag() bool

GetGameEndFlag ゲーム終了フラグ

### func (*BlackJack) GetInsuranceBet

func (b *BlackJack) GetInsuranceBet() int

GetInsuranceBet インシュランスベット額

### func (*BlackJack) GetMultiHandCount

func (b *BlackJack) GetMultiHandCount() int

GetMultiHandCount マルチハンド数取得

### func (*BlackJack) GetPerfectPairsBet

func (b *BlackJack) GetPerfectPairsBet() int

GetPerfectPairsBet Perfect Pairsベット額取得

### func (*BlackJack) GetPhase

func (b *BlackJack) GetPhase() int

GetPhase 現在のフェーズ

### func (*BlackJack) GetPlayer

func (b *BlackJack) GetPlayer() *BlackJackPlayer

GetPlayer プレイヤー

### func (*BlackJack) GetPlayerHands

func (b *BlackJack) GetPlayerHands() []*BlackJackHand

GetPlayerHands プレイヤーハンド一覧

### func (*BlackJack) GetRunningCount

func (b *BlackJack) GetRunningCount() int

GetRunningCount ランニングカウント取得

### func (*BlackJack) GetSideBetResults

func (b *BlackJack) GetSideBetResults() []*BJSideBetResult

GetSideBetResults サイドベット結果取得

### func (*BlackJack) GetTrueCount

func (b *BlackJack) GetTrueCount() float64

GetTrueCount トゥルーカウント取得 (アンバランスドシステム(KO)では0を返す)

### func (*BlackJack) IsCountingEnabled

func (b *BlackJack) IsCountingEnabled() bool

IsCountingEnabled カウンティング有効か

### func (*BlackJack) IsHintEnabled

func (b *BlackJack) IsHintEnabled() bool

IsHintEnabled ヒント有効か

### func (*BlackJack) IsInsuranceAvailable

func (b *BlackJack) IsInsuranceAvailable() bool

IsInsuranceAvailable インシュランス可能か

### func (*BlackJack) MarshalJSON

func (b *BlackJack) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*BlackJack) PlayerBet

func (b *BlackJack) PlayerBet(amount, ppBet, t3Bet, handCount int) error

PlayerBet プレイヤーベット

### func (*BlackJack) PlayerDeclineEarlySurrender

func (b *BlackJack) PlayerDeclineEarlySurrender() error

PlayerDeclineEarlySurrender プレイヤーアーリーサレンダー辞退

### func (*BlackJack) PlayerDeclineInsurance

func (b *BlackJack) PlayerDeclineInsurance() error

PlayerDeclineInsurance プレイヤーインシュランス辞退

### func (*BlackJack) PlayerDoubleDown

func (b *BlackJack) PlayerDoubleDown() error

PlayerDoubleDown プレイヤーダブルダウン

### func (*BlackJack) PlayerEarlySurrender

func (b *BlackJack) PlayerEarlySurrender() error

PlayerEarlySurrender プレイヤーアーリーサレンダー

### func (*BlackJack) PlayerHit

func (b *BlackJack) PlayerHit() error

PlayerHit プレイヤーヒット

### func (*BlackJack) PlayerInsurance

func (b *BlackJack) PlayerInsurance() error

PlayerInsurance プレイヤーインシュランス

### func (*BlackJack) PlayerSplit

func (b *BlackJack) PlayerSplit() error

PlayerSplit プレイヤースプリット

### func (*BlackJack) PlayerStand

func (b *BlackJack) PlayerStand() error

PlayerStand プレイヤースタンド

### func (*BlackJack) PlayerSurrender

func (b *BlackJack) PlayerSurrender() error

PlayerSurrender プレイヤーサレンダー(ベット半額返却して降りる)

### func (*BlackJack) Reset

func (b *BlackJack) Reset()

Reset ゲーム初期化(hintEnabled/deckCount/configは保持)

### func (*BlackJack) SetConfig

func (b *BlackJack) SetConfig(config BlackJackConfig) error

SetConfig ゲーム設定(BETフェーズのみ)

### func (*BlackJack) SetDeckCount

func (b *BlackJack) SetDeckCount(count int) error

SetDeckCount デッキ数設定(BETフェーズのみ)

### func (*BlackJack) SetMultiHandCount

func (b *BlackJack) SetMultiHandCount(count int)

SetMultiHandCount マルチハンド数設定(テスト用)

### func (*BlackJack) ToggleHint

func (b *BlackJack) ToggleHint()

ToggleHint ヒント表示のON/OFF切り替え

### func (*BlackJack) UnmarshalJSON

func (b *BlackJack) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type BlackJackConfig

BlackJackConfig ブラックジャックゲーム設定

type BlackJackConfig struct {
    DealerHitsSoft17 bool `json:"dh"` // ディーラーがソフト17でヒットするか (H17 vs S17)
    CpuPlayerCount   int  `json:"cp"` // CPUプレイヤー数 (0-3)
    CountingEnabled  bool `json:"ce"` // カウンティング表示有効
    DoubleAfterSplit bool `json:"ds"` // スプリット後のダブルダウン許可 (DAS)
    CountingSystem   int  `json:"cs"` // カウンティングシステム (0=Hi-Lo, 1=KO, 2=Zen, 3=Omega II)
    DeckPenetration  int  `json:"dp"` // デッキペネトレーション率(%) (50 or 75, 0=デフォルト75)
    SurrenderRule    int  `json:"sr"` // サレンダールール (0=Late, 1=Early, 2=None)
}

### func DefaultBlackJackConfig

func DefaultBlackJackConfig() BlackJackConfig

DefaultBlackJackConfig デフォルト設定 (全機能無効)

### func (BlackJackConfig) Validate

func (c BlackJackConfig) Validate() error

Validate 設定値のドメインバリデーション

## type BlackJackCpuSeat

BlackJackCpuSeat CPUプレイヤー席

type BlackJackCpuSeat struct {
    // contains filtered or unexported fields
}

### func NewBlackJackCpuSeat

func NewBlackJackCpuSeat() *BlackJackCpuSeat

NewBlackJackCpuSeat コンストラクタ

### func (*BlackJackCpuSeat) GetHands

func (c *BlackJackCpuSeat) GetHands() []*BlackJackHand

GetHands ハンド一覧取得

### func (*BlackJackCpuSeat) GetInsuranceBet

func (c *BlackJackCpuSeat) GetInsuranceBet() int

GetInsuranceBet インシュランスベット取得

### func (*BlackJackCpuSeat) GetPlayer

func (c *BlackJackCpuSeat) GetPlayer() *BlackJackPlayer

GetPlayer プレイヤー取得

### func (*BlackJackCpuSeat) MarshalJSON

func (c *BlackJackCpuSeat) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*BlackJackCpuSeat) Reset

func (c *BlackJackCpuSeat) Reset()

Reset ハンドリセット(チップは保持)

### func (*BlackJackCpuSeat) SetHands

func (c *BlackJackCpuSeat) SetHands(hands []*BlackJackHand)

SetHands ハンド設定(スプリット用)

### func (*BlackJackCpuSeat) SetInsuranceBet

func (c *BlackJackCpuSeat) SetInsuranceBet(bet int)

SetInsuranceBet インシュランスベット設定

### func (*BlackJackCpuSeat) UnmarshalJSON

func (c *BlackJackCpuSeat) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type BlackJackHand

BlackJackHand ブラックジャックハンド(分割対応)

type BlackJackHand struct {
    // contains filtered or unexported fields
}

### func NewBlackJackHand

func NewBlackJackHand() *BlackJackHand

NewBlackJackHand コンストラクタ

### func (*BlackJackHand) AddCard

func (h *BlackJackHand) AddCard(card *Card)

AddCard カード追加

### func (*BlackJackHand) CanSplit

func (h *BlackJackHand) CanSplit() bool

CanSplit スプリット可能か(2枚でBJ値が同じ)

### func (*BlackJackHand) CanSurrender

func (h *BlackJackHand) CanSurrender() bool

CanSurrender サレンダー可能か(2枚でスタンド/バースト/サレンダー前)

### func (*BlackJackHand) GetBet

func (h *BlackJackHand) GetBet() int

GetBet ベット額取得

### func (*BlackJackHand) GetCard

func (h *BlackJackHand) GetCard(idx int) *Card

GetCard 指定番目のカード取得

### func (*BlackJackHand) GetCards

func (h *BlackJackHand) GetCards() []*Card

GetCards カード一覧取得

### func (*BlackJackHand) GetCardsSize

func (h *BlackJackHand) GetCardsSize() int

GetCardsSize カード枚数取得

### func (*BlackJackHand) GetScore

func (h *BlackJackHand) GetScore() int

GetScore 手札から現在のスコア計算

### func (*BlackJackHand) IsBlackJack

func (h *BlackJackHand) IsBlackJack() bool

IsBlackJack ナチュラルブラックジャックか(2枚でスコア21)

### func (*BlackJackHand) IsBusted

func (h *BlackJackHand) IsBusted() bool

IsBusted バーストしたか

### func (*BlackJackHand) IsDoubled

func (h *BlackJackHand) IsDoubled() bool

IsDoubled ダブルダウン済みか

### func (*BlackJackHand) IsFinished

func (h *BlackJackHand) IsFinished() bool

IsFinished ハンドが完了しているか

### func (*BlackJackHand) IsFromSplit

func (h *BlackJackHand) IsFromSplit() bool

IsFromSplit スプリットから生じたハンドか

### func (*BlackJackHand) IsSoft

func (h *BlackJackHand) IsSoft() bool

IsSoft ソフトハンド(11として有効なエースを含む)かどうか判定

### func (*BlackJackHand) IsStood

func (h *BlackJackHand) IsStood() bool

IsStood スタンド済みか

### func (*BlackJackHand) IsSurrendered

func (h *BlackJackHand) IsSurrendered() bool

IsSurrendered サレンダー済みか

### func (*BlackJackHand) MarshalJSON

func (h *BlackJackHand) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*BlackJackHand) Reset

func (h *BlackJackHand) Reset()

Reset ハンドリセット

### func (*BlackJackHand) SetBet

func (h *BlackJackHand) SetBet(bet int)

SetBet ベット額設定

### func (*BlackJackHand) SetBusted

func (h *BlackJackHand) SetBusted(busted bool)

SetBusted バースト状態設定

### func (*BlackJackHand) SetDoubled

func (h *BlackJackHand) SetDoubled(doubled bool)

SetDoubled ダブルダウン状態設定

### func (*BlackJackHand) SetFromSplit

func (h *BlackJackHand) SetFromSplit(fromSplit bool)

SetFromSplit スプリット由来フラグ設定

### func (*BlackJackHand) SetStood

func (h *BlackJackHand) SetStood(stood bool)

SetStood スタンド状態設定

### func (*BlackJackHand) SetSurrendered

func (h *BlackJackHand) SetSurrendered(surrendered bool)

SetSurrendered サレンダー状態設定

### func (*BlackJackHand) UnmarshalJSON

func (h *BlackJackHand) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type BlackJackPlayer

BlackJackPlayer ブラックジャックプレイヤークラス

type BlackJackPlayer struct {
    Player     // 親クラス
    ChipHolder // チップ管理
}

### func NewBlackJackPlayer

func NewBlackJackPlayer() *BlackJackPlayer

NewBlackJackPlayer コンストラクタ

### func (*BlackJackPlayer) GetScore

func (bp *BlackJackPlayer) GetScore() int

GetScore 手札から現在のスコア計算

### func (*BlackJackPlayer) IsSoft

func (bp *BlackJackPlayer) IsSoft() bool

IsSoft ソフトハンド(11として有効なエースを含む)かどうか判定

### func (*BlackJackPlayer) MarshalJSON

func (bp *BlackJackPlayer) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*BlackJackPlayer) UnmarshalJSON

func (bp *BlackJackPlayer) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type Bridge

Bridge ブリッジゲームクラス

type Bridge struct {
    // contains filtered or unexported fields
}

### func NewBridge

func NewBridge(trumpCards *TrumpCards, players []*BridgePlayer, config BridgeConfig) *Bridge

NewBridge コンストラクタ

### func (*Bridge) CpuBid

func (b *Bridge) CpuBid()

CpuBid CPUプレイヤーがビッドする

### func (*Bridge) CpuPlay

func (b *Bridge) CpuPlay()

CpuPlay CPUプレイヤーが1ターン実行

### func (*Bridge) GetActionLog

func (b *Bridge) GetActionLog() []*ActionLogEntry

GetActionLog 棋譜取得

### func (*Bridge) GetBelowLine

func (b *Bridge) GetBelowLine(team int) int

GetBelowLine ライン以下スコア取得

### func (*Bridge) GetBidHistory

func (b *Bridge) GetBidHistory() []*BridgeBidEntry

GetBidHistory ビッド履歴取得

### func (*Bridge) GetBidPlayerIdx

func (b *Bridge) GetBidPlayerIdx() int

GetBidPlayerIdx ビッドプレイヤーインデックス取得

### func (*Bridge) GetConfig

func (b *Bridge) GetConfig() BridgeConfig

GetConfig 設定取得

### func (*Bridge) GetContractLevel

func (b *Bridge) GetContractLevel() int

GetContractLevel コントラクトレベル取得

### func (*Bridge) GetContractSuit

func (b *Bridge) GetContractSuit() int

GetContractSuit コントラクトスート取得

### func (*Bridge) GetCurrentPlayerIdx

func (b *Bridge) GetCurrentPlayerIdx() int

GetCurrentPlayerIdx 現在のプレイヤーインデックス取得

### func (*Bridge) GetCurrentTrick

func (b *Bridge) GetCurrentTrick() []*BridgeTrickCard

GetCurrentTrick 現在のトリック取得

### func (*Bridge) GetDealerIdx

func (b *Bridge) GetDealerIdx() int

GetDealerIdx ディーラーインデックス取得

### func (*Bridge) GetDeclarerIdx

func (b *Bridge) GetDeclarerIdx() int

GetDeclarerIdx デクレアラーインデックス取得

### func (*Bridge) GetDoubled

func (b *Bridge) GetDoubled() int

GetDoubled ダブル状態取得 (0=なし, 1=ダブル, 2=リダブル)

### func (*Bridge) GetDummyHand

func (b *Bridge) GetDummyHand() []*Card

GetDummyHand ダミーの手札を取得 (オープニングリード後のみ公開)

### func (*Bridge) GetDummyIdx

func (b *Bridge) GetDummyIdx() int

GetDummyIdx ダミーインデックス取得

### func (*Bridge) GetGameEndFlag

func (b *Bridge) GetGameEndFlag() bool

GetGameEndFlag ゲーム終了フラグ取得

### func (*Bridge) GetGamesWon

func (b *Bridge) GetGamesWon(team int) int

GetGamesWon 勝利ゲーム数取得

### func (*Bridge) GetHint

func (b *Bridge) GetHint() *BridgeHint

GetHint ヒントを取得する

### func (*Bridge) GetLeadPlayerIdx

func (b *Bridge) GetLeadPlayerIdx() int

GetLeadPlayerIdx リードプレイヤーインデックス取得

### func (*Bridge) GetPhase

func (b *Bridge) GetPhase() BridgePhase

GetPhase 現在のフェーズ取得

### func (*Bridge) GetPlayer

func (b *Bridge) GetPlayer(i int) *BridgePlayer

GetPlayer プレイヤー取得

### func (*Bridge) GetPlayerCnt

func (b *Bridge) GetPlayerCnt() int

GetPlayerCnt プレイヤー数取得

### func (*Bridge) GetRoundNumber

func (b *Bridge) GetRoundNumber() int

GetRoundNumber 現在のラウンド番号取得

### func (*Bridge) GetTeamScore

func (b *Bridge) GetTeamScore(team int) int

GetTeamScore チームスコア取得

### func (*Bridge) GetTrickNumber

func (b *Bridge) GetTrickNumber() int

GetTrickNumber 現在のトリック番号取得

### func (*Bridge) GetTrumpSuit

func (b *Bridge) GetTrumpSuit() int

GetTrumpSuit 切り札スート取得 (-1 = NoTrump)

### func (*Bridge) GetValidPlayIndices

func (b *Bridge) GetValidPlayIndices(playerIdx int) []int

GetValidPlayIndices プレイ可能なカードのインデックスリストを返す

### func (*Bridge) GetVulnerability

func (b *Bridge) GetVulnerability(team int) bool

GetVulnerability バルネラビリティ取得

### func (*Bridge) GetWinnerTeam

func (b *Bridge) GetWinnerTeam() int

GetWinnerTeam 勝利チーム取得 (-1 = 未確定)

### func (*Bridge) IsHumanBidTurn

func (b *Bridge) IsHumanBidTurn() bool

IsHumanBidTurn 現在のビッド手番が人間かどうか

### func (*Bridge) IsHumanTurn

func (b *Bridge) IsHumanTurn() bool

IsHumanTurn 現在の手番が人間かどうか

### func (*Bridge) IsOpeningLeadDone

func (b *Bridge) IsOpeningLeadDone() bool

IsOpeningLeadDone オープニングリード完了か

### func (*Bridge) MarshalJSON

func (b *Bridge) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*Bridge) NextRound

func (b *Bridge) NextRound()

NextRound 次のラウンドを開始する

### func (*Bridge) NextTrick

func (b *Bridge) NextTrick()

NextTrick 次のトリックを開始する

### func (*Bridge) PlayerBid

func (b *Bridge) PlayerBid(bidType int, level int, suit int) error

PlayerBid 人間プレイヤーがビッドする

### func (*Bridge) PlayerPlay

func (b *Bridge) PlayerPlay(cardIndex int) error

PlayerPlay 人間プレイヤーがカードをプレイする

### func (*Bridge) Reset

func (b *Bridge) Reset()

Reset ゲーム初期化

### func (*Bridge) ResolveTrick

func (b *Bridge) ResolveTrick()

ResolveTrick トリックを解決して勝者を決定する

### func (*Bridge) ScoreRound

func (b *Bridge) ScoreRound()

ScoreRound ラウンドのスコアを確定し、ゲーム終了判定を行う

### func (*Bridge) SetBelowLine

func (b *Bridge) SetBelowLine(team, score int)

SetBelowLine ライン以下スコア設定 (テスト用)

### func (*Bridge) SetBidPlayerIdx

func (b *Bridge) SetBidPlayerIdx(idx int)

SetBidPlayerIdx ビッドプレイヤーインデックス設定 (テスト用)

### func (*Bridge) SetConfig

func (b *Bridge) SetConfig(cfg BridgeConfig)

SetConfig 設定変更

### func (*Bridge) SetContractLevel

func (b *Bridge) SetContractLevel(level int)

SetContractLevel コントラクトレベル設定 (テスト用)

### func (*Bridge) SetContractSuit

func (b *Bridge) SetContractSuit(suit int)

SetContractSuit コントラクトスート設定 (テスト用)

### func (*Bridge) SetCurrentPlayerIdx

func (b *Bridge) SetCurrentPlayerIdx(idx int)

SetCurrentPlayerIdx プレイヤーインデックス設定 (テスト用)

### func (*Bridge) SetCurrentTrick

func (b *Bridge) SetCurrentTrick(trick []*BridgeTrickCard)

SetCurrentTrick トリック設定 (テスト用)

### func (*Bridge) SetDealerIdx

func (b *Bridge) SetDealerIdx(idx int)

SetDealerIdx ディーラーインデックス設定 (テスト用)

### func (*Bridge) SetDeclarerIdx

func (b *Bridge) SetDeclarerIdx(idx int)

SetDeclarerIdx デクレアラーインデックス設定 (テスト用)

### func (*Bridge) SetDoubled

func (b *Bridge) SetDoubled(d int)

SetDoubled ダブル状態設定 (テスト用)

### func (*Bridge) SetDummyIdx

func (b *Bridge) SetDummyIdx(idx int)

SetDummyIdx ダミーインデックス設定 (テスト用)

### func (*Bridge) SetGamesWon

func (b *Bridge) SetGamesWon(team, wins int)

SetGamesWon 勝利ゲーム数設定 (テスト用)

### func (*Bridge) SetLeadPlayerIdx

func (b *Bridge) SetLeadPlayerIdx(idx int)

SetLeadPlayerIdx リードプレイヤーインデックス設定 (テスト用)

### func (*Bridge) SetPhase

func (b *Bridge) SetPhase(phase BridgePhase)

SetPhase フェーズ設定 (テスト用)

### func (*Bridge) SetRoundNumber

func (b *Bridge) SetRoundNumber(n int)

SetRoundNumber ラウンド番号設定 (テスト用)

### func (*Bridge) SetTeamScore

func (b *Bridge) SetTeamScore(team, score int)

SetTeamScore チームスコア設定 (テスト用)

### func (*Bridge) SetTrickNumber

func (b *Bridge) SetTrickNumber(n int)

SetTrickNumber トリック番号設定 (テスト用)

### func (*Bridge) SetTrumpSuit

func (b *Bridge) SetTrumpSuit(suit int)

SetTrumpSuit 切り札スート設定 (テスト用)

### func (*Bridge) SetVulnerability

func (b *Bridge) SetVulnerability(team int, vul bool)

SetVulnerability バルネラビリティ設定 (テスト用)

### func (*Bridge) UnmarshalJSON

func (b *Bridge) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type BridgeBidEntry

BridgeBidEntry オークション中の1ビッドエントリ

type BridgeBidEntry struct {
    PlayerIdx int           `json:"pi"`
    BidType   BridgeBidType `json:"bt"`
    Level     int           `json:"lv"` // 1-7 (BidNormal時のみ)
    Suit      int           `json:"su"` // BridgeBidSuitClub-BridgeBidSuitNT (BidNormal時のみ)
}

## type BridgeBidType

BridgeBidType ビッドの種類

type BridgeBidType int

ビッド種類定数

const (
    // BridgeBidPass パス
    BridgeBidPass BridgeBidType = 0
    // BridgeBidNormal 通常ビッド (レベル+スート)
    BridgeBidNormal BridgeBidType = 1
    // BridgeBidDouble ダブル
    BridgeBidDouble BridgeBidType = 2
    // BridgeBidRedouble リダブル
    BridgeBidRedouble BridgeBidType = 3
)

## type BridgeConfig

BridgeConfig ブリッジゲーム設定

type BridgeConfig struct {
    CpuDifficulty BridgeCpuDifficulty `json:"cd"`
}

### func DefaultBridgeConfig

func DefaultBridgeConfig() BridgeConfig

DefaultBridgeConfig デフォルト設定を返す

### func (BridgeConfig) Validate

func (c BridgeConfig) Validate() error

Validate 設定値のドメインバリデーション

## type BridgeCpuDifficulty

BridgeCpuDifficulty CPU の難易度レベル

type BridgeCpuDifficulty int

ブリッジのCPU難易度定数

const (
    // BridgeCpuDifficultyEasy 低難易度 (ランダムビッド・プレイ)
    BridgeCpuDifficultyEasy BridgeCpuDifficulty = iota
    // BridgeCpuDifficultyNormal 中難易度 (ポイントカウント制ビッド)
    BridgeCpuDifficultyNormal
    // BridgeCpuDifficultyHard 高難易度 (戦略的プレイ)
    BridgeCpuDifficultyHard
)

## type BridgeHint

BridgeHint ヒント情報

type BridgeHint struct {
    CardIndex *int   // 推奨カードインデックス (プレイ時)
    BidType   *int   // 推奨ビッド種類
    BidLevel  *int   // 推奨ビッドレベル
    BidSuit   *int   // 推奨ビッドスート
    Reason    string // ヒント理由キー
}

## type BridgePhase

BridgePhase ゲームフェーズ

type BridgePhase int

ブリッジのフェーズ定数

const (
    // BridgePhaseBid オークション(ビッド)フェーズ
    BridgePhaseBid BridgePhase = 0
    // BridgePhasePlay トリックプレイフェーズ
    BridgePhasePlay BridgePhase = 1
    // BridgePhaseTrickEnd トリック終了フェーズ
    BridgePhaseTrickEnd BridgePhase = 2
    // BridgePhaseRoundEnd ラウンド終了フェーズ
    BridgePhaseRoundEnd BridgePhase = 3
    // BridgePhaseGameEnd ゲーム終了フェーズ
    BridgePhaseGameEnd BridgePhase = 4
)

## type BridgePlayer

BridgePlayer ブリッジプレイヤークラス

type BridgePlayer struct {
    *GamePlayer
    TrickHolder
    // contains filtered or unexported fields
}

### func NewBridgePlayer

func NewBridgePlayer(isHuman bool, team int) *BridgePlayer

NewBridgePlayer コンストラクタ

### func (*BridgePlayer) GetTeam

func (p *BridgePlayer) GetTeam() int

GetTeam チームインデックスを取得

### func (*BridgePlayer) MarshalJSON

func (p *BridgePlayer) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*BridgePlayer) ResetRound

func (p *BridgePlayer) ResetRound()

ResetRound ラウンドをリセット(トリック・手札・終了状態を初期化)

### func (*BridgePlayer) UnmarshalJSON

func (p *BridgePlayer) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type BridgeTrickCard

BridgeTrickCard トリック中の1枚

type BridgeTrickCard struct {
    PlayerIdx int   `json:"pi"`
    Card      *Card `json:"c"`
}

## type Canasta

Canasta カナスタゲームクラス

type Canasta struct {
    // contains filtered or unexported fields
}

### func NewCanasta

func NewCanasta(trumpCards *TrumpCards, players []*CanastaPlayer, config CanastaConfig) *Canasta

NewCanasta コンストラクタ

### func (*Canasta) CpuPlay

func (g *Canasta) CpuPlay()

CpuPlay 現在の手番がCPUの場合にターンを実行

### func (*Canasta) GetActionLog

func (g *Canasta) GetActionLog() []*ActionLogEntry

GetActionLog 棋譜取得

### func (*Canasta) GetConfig

func (g *Canasta) GetConfig() CanastaConfig

GetConfig 設定取得

### func (*Canasta) GetCurrentPlayerIdx

func (g *Canasta) GetCurrentPlayerIdx() int

GetCurrentPlayerIdx 現在のプレイヤーインデックス取得

### func (*Canasta) GetDiscardPile

func (g *Canasta) GetDiscardPile() []*Card

GetDiscardPile 捨て札の山を取得

### func (*Canasta) GetDiscardPileCount

func (g *Canasta) GetDiscardPileCount() int

GetDiscardPileCount 捨て札の枚数取得

### func (*Canasta) GetDiscardTop

func (g *Canasta) GetDiscardTop() *Card

GetDiscardTop 捨て札の一番上を取得

### func (*Canasta) GetDrawPileCount

func (g *Canasta) GetDrawPileCount() int

GetDrawPileCount 山札の残り枚数取得

### func (*Canasta) GetDrewFromDiscard

func (g *Canasta) GetDrewFromDiscard() bool

GetDrewFromDiscard 捨て札から引いたか取得

### func (*Canasta) GetGameEndFlag

func (g *Canasta) GetGameEndFlag() bool

GetGameEndFlag ゲーム終了フラグ取得

### func (*Canasta) GetIsFrozen

func (g *Canasta) GetIsFrozen() bool

GetIsFrozen 捨て札の山がフリーズ状態か取得

### func (*Canasta) GetPhase

func (g *Canasta) GetPhase() CanastaPhase

GetPhase 現在のフェーズ取得

### func (*Canasta) GetPlayer

func (g *Canasta) GetPlayer(i int) *CanastaPlayer

GetPlayer プレイヤー取得

### func (*Canasta) GetPlayerCnt

func (g *Canasta) GetPlayerCnt() int

GetPlayerCnt プレイヤー数取得

### func (*Canasta) GetRoundNumber

func (g *Canasta) GetRoundNumber() int

GetRoundNumber 現在のラウンド番号取得

### func (*Canasta) GetWinnerIdx

func (g *Canasta) GetWinnerIdx() int

GetWinnerIdx 勝者インデックス取得 (-1 = 未確定)

### func (*Canasta) IsHumanTurn

func (g *Canasta) IsHumanTurn() bool

IsHumanTurn 現在の手番が人間かどうか

### func (*Canasta) MarshalJSON

func (g *Canasta) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*Canasta) NextRound

func (g *Canasta) NextRound()

NextRound 次のラウンドを開始する

### func (*Canasta) PlayerDiscard

func (g *Canasta) PlayerDiscard(cardIndex int) error

PlayerDiscard 人間プレイヤーがカードを捨てる

### func (*Canasta) PlayerDrawFromDiscard

func (g *Canasta) PlayerDrawFromDiscard(naturalPairIndices []int) error

PlayerDrawFromDiscard 人間プレイヤーが捨て札の山を取る

### func (*Canasta) PlayerDrawFromStock

func (g *Canasta) PlayerDrawFromStock() error

PlayerDrawFromStock 人間プレイヤーが山札からカードを引く

### func (*Canasta) PlayerGoOut

func (g *Canasta) PlayerGoOut() error

PlayerGoOut 人間プレイヤーが上がる

### func (*Canasta) PlayerMeld

func (g *Canasta) PlayerMeld(meldGroups [][]int) error

PlayerMeld 人間プレイヤーがメルドを出す

### func (*Canasta) PlayerSkipMeld

func (g *Canasta) PlayerSkipMeld() error

PlayerSkipMeld メルドフェーズをスキップする

### func (*Canasta) Reset

func (g *Canasta) Reset()

Reset ゲーム初期化

### func (*Canasta) SetConfig

func (g *Canasta) SetConfig(cfg CanastaConfig)

SetConfig 設定変更

### func (*Canasta) SetCurrentPlayerIdx

func (g *Canasta) SetCurrentPlayerIdx(idx int)

SetCurrentPlayerIdx プレイヤーインデックス設定 (テスト用)

### func (*Canasta) SetDiscardPile

func (g *Canasta) SetDiscardPile(pile []*Card)

SetDiscardPile 捨て札の山を設定 (テスト用)

### func (*Canasta) SetDrawPile

func (g *Canasta) SetDrawPile(pile []*Card)

SetDrawPile 山札を設定 (テスト用)

### func (*Canasta) SetGameEndFlag

func (g *Canasta) SetGameEndFlag(v bool)

SetGameEndFlag ゲーム終了フラグ設定 (テスト用)

### func (*Canasta) SetIsFrozen

func (g *Canasta) SetIsFrozen(v bool)

SetIsFrozen フリーズ状態設定 (テスト用)

### func (*Canasta) SetPhase

func (g *Canasta) SetPhase(phase CanastaPhase)

SetPhase フェーズ設定 (テスト用)

### func (*Canasta) SetRoundNumber

func (g *Canasta) SetRoundNumber(n int)

SetRoundNumber ラウンド番号設定 (テスト用)

### func (*Canasta) UnmarshalJSON

func (g *Canasta) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type CanastaConfig

CanastaConfig カナスタゲーム設定

type CanastaConfig struct {
    CpuDifficulty CanastaCpuDifficulty `json:"cd"`
    PointLimit    int                  `json:"pl"` // ゲーム終了スコア (先に到達したプレイヤーが勝利)
}

### func DefaultCanastaConfig

func DefaultCanastaConfig() CanastaConfig

DefaultCanastaConfig デフォルト設定を返す

### func (CanastaConfig) Validate

func (c CanastaConfig) Validate() error

Validate 設定値のドメインバリデーション

## type CanastaCpuDifficulty

CanastaCpuDifficulty CPU の難易度レベル

type CanastaCpuDifficulty int

CanastaのCPU難易度定数

const (
    // CanastaCpuDifficultyEasy 低難易度
    CanastaCpuDifficultyEasy CanastaCpuDifficulty = iota
    // CanastaCpuDifficultyNormal 中難易度
    CanastaCpuDifficultyNormal
    // CanastaCpuDifficultyHard 高難易度
    CanastaCpuDifficultyHard
)

## type CanastaMeld

CanastaMeld テーブル上のメルド

type CanastaMeld struct {
    Cards     []*Card `json:"ca"`
    IsNatural bool    `json:"in"` // ワイルドカードを含まない場合 true
}

### func (*CanastaMeld) GetRank

func (m *CanastaMeld) GetRank() int

GetRank メルドのランク(ナチュラルカードのランク)を返す

### func (*CanastaMeld) IsCanasta

func (m *CanastaMeld) IsCanasta() bool

IsCanasta 7枚以上のメルドかどうか

## type CanastaPhase

CanastaPhase ゲームフェーズ

type CanastaPhase int

Canastaのフェーズ定数

const (
    // CanastaPhaseDraw ドローフェーズ (山札または捨て札から引く)
    CanastaPhaseDraw CanastaPhase = 0
    // CanastaPhaseMeld メルドフェーズ (メルドを出す/既存メルドに追加する)
    CanastaPhaseMeld CanastaPhase = 1
    // CanastaPhaseDiscard ディスカードフェーズ (手札から1枚捨てる or 上がる)
    CanastaPhaseDiscard CanastaPhase = 2
    // CanastaPhaseRoundEnd ラウンド終了フェーズ
    CanastaPhaseRoundEnd CanastaPhase = 3
    // CanastaPhaseGameEnd ゲーム終了フェーズ
    CanastaPhaseGameEnd CanastaPhase = 4
)

## type CanastaPlayer

CanastaPlayer カナスタプレイヤークラス

type CanastaPlayer struct {
    *GamePlayer
    RoundScoreHolder
    // contains filtered or unexported fields
}

### func NewCanastaPlayer

func NewCanastaPlayer(isHuman bool) *CanastaPlayer

NewCanastaPlayer コンストラクタ

### func (*CanastaPlayer) AddMeld

func (p *CanastaPlayer) AddMeld(meld *CanastaMeld)

AddMeld メルドを追加

### func (*CanastaPlayer) AddRed3

func (p *CanastaPlayer) AddRed3(card *Card)

AddRed3 赤3を追加

### func (*CanastaPlayer) GetHasInitMeld

func (p *CanastaPlayer) GetHasInitMeld() bool

GetHasInitMeld 初回メルド済みフラグ取得

### func (*CanastaPlayer) GetMelds

func (p *CanastaPlayer) GetMelds() []*CanastaMeld

GetMelds メルドを取得

### func (*CanastaPlayer) GetRed3s

func (p *CanastaPlayer) GetRed3s() []*Card

GetRed3s 赤3を取得

### func (*CanastaPlayer) HasCanasta

func (p *CanastaPlayer) HasCanasta() bool

HasCanasta カナスタ(7枚以上のメルド)を持っているか

### func (*CanastaPlayer) MarshalJSON

func (p *CanastaPlayer) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*CanastaPlayer) ResetRound

func (p *CanastaPlayer) ResetRound()

ResetRound ラウンドをリセット(手札・スコア・メルド・赤3を初期化)

### func (*CanastaPlayer) SetHasInitMeld

func (p *CanastaPlayer) SetHasInitMeld(v bool)

SetHasInitMeld 初回メルド済みフラグ設定

### func (*CanastaPlayer) SetMelds

func (p *CanastaPlayer) SetMelds(melds []*CanastaMeld)

SetMelds メルドを設定 (テスト用)

### func (*CanastaPlayer) SetRed3s

func (p *CanastaPlayer) SetRed3s(red3s []*Card)

SetRed3s 赤3を設定 (テスト用)

### func (*CanastaPlayer) UnmarshalJSON

func (p *CanastaPlayer) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type Card

Card カードクラス

type Card struct {
    // contains filtered or unexported fields
}

### func FindBestMelds

func FindBestMelds(cards []*Card) (melds [][]*Card, deadwood []*Card)

FindBestMelds カードの最適なメルド分割を見つける (デッドウッドを最小化)

### func NewCard

func NewCard(design int, value int, draw bool) *Card

NewCard コンストラクタ

### func (*Card) GetDesign

func (c *Card) GetDesign() int

GetDesign カード種類取得

### func (*Card) GetDraw

func (c *Card) GetDraw() bool

GetDraw カード払い出しフラグ取得

### func (*Card) GetValue

func (c *Card) GetValue() int

GetValue カード値取得

### func (*Card) MarshalJSON

func (c *Card) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*Card) SetDraw

func (c *Card) SetDraw(draw bool)

SetDraw カード払い出しフラグ設定

### func (*Card) UnmarshalJSON

func (c *Card) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type ChipHolder

ChipHolder チップ管理の共通構造体

type ChipHolder struct {
    // contains filtered or unexported fields
}

### func (*ChipHolder) AddChips

func (ch *ChipHolder) AddChips(amount int)

AddChips チップ追加

### func (*ChipHolder) GetChips

func (ch *ChipHolder) GetChips() int

GetChips チップ取得

### func (*ChipHolder) MarshalJSON

func (ch *ChipHolder) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*ChipHolder) SetChips

func (ch *ChipHolder) SetChips(chips int)

SetChips チップ設定

### func (*ChipHolder) SubtractChips

func (ch *ChipHolder) SubtractChips(amount int) bool

SubtractChips チップ減算 (不足時はfalseを返す)

### func (*ChipHolder) UnmarshalJSON

func (ch *ChipHolder) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type ClockSolitaire

ClockSolitaire クロックソリティアゲームクラス

type ClockSolitaire struct {
    // contains filtered or unexported fields
}

### func NewClockSolitaire

func NewClockSolitaire(trumpCards *TrumpCards) *ClockSolitaire

NewClockSolitaire コンストラクタ

### func (*ClockSolitaire) AutoPlay

func (cs *ClockSolitaire) AutoPlay() error

AutoPlay 自動プレイ(全ステップ実行)

### func (*ClockSolitaire) GetActionLog

func (cs *ClockSolitaire) GetActionLog() []*ActionLogEntry

GetActionLog 棋譜取得

### func (*ClockSolitaire) GetCurrentCard

func (cs *ClockSolitaire) GetCurrentCard() *Card

GetCurrentCard 現在のカード取得

### func (*ClockSolitaire) GetFaceUpCount

func (cs *ClockSolitaire) GetFaceUpCount() [ClockSolitairePileCount]int

GetFaceUpCount 表向き枚数取得

### func (*ClockSolitaire) GetPhase

func (cs *ClockSolitaire) GetPhase() ClockSolitairePhase

GetPhase フェーズ取得

### func (*ClockSolitaire) GetPiles

func (cs *ClockSolitaire) GetPiles() [ClockSolitairePileCount][]*ClockSolitaireCard

GetPiles パイル取得

### func (*ClockSolitaire) GetStepCount

func (cs *ClockSolitaire) GetStepCount() int

GetStepCount ステップ数取得

### func (*ClockSolitaire) MarshalJSON

func (cs *ClockSolitaire) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*ClockSolitaire) Reset

func (cs *ClockSolitaire) Reset()

Reset ゲームリセット

### func (*ClockSolitaire) Step

func (cs *ClockSolitaire) Step() error

Step 1ステップ実行

### func (*ClockSolitaire) UnmarshalJSON

func (cs *ClockSolitaire) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type ClockSolitaireCard

ClockSolitaireCard パイル上のカード

type ClockSolitaireCard struct {
    Card   *Card `json:"c"`
    FaceUp bool  `json:"f"`
}

## type ClockSolitairePhase

ClockSolitairePhase クロックソリティアゲームフェーズ

type ClockSolitairePhase int

ClockSolitaireのフェーズ定数

const (
    // ClockSolitairePhasePlaying プレイ中
    ClockSolitairePhasePlaying ClockSolitairePhase = iota
    // ClockSolitairePhaseGameClear ゲームクリア
    ClockSolitairePhaseGameClear
    // ClockSolitairePhaseGameOver ゲームオーバー
    ClockSolitairePhaseGameOver
)

## type CrazyEights

CrazyEights クレイジーエイトゲームクラス

type CrazyEights struct {
    // contains filtered or unexported fields
}

### func NewCrazyEights

func NewCrazyEights(trumpCards *TrumpCards, players []*CrazyEightsPlayer, config CrazyEightsConfig) *CrazyEights

NewCrazyEights コンストラクタ

### func (*CrazyEights) CpuChooseSuit

func (g *CrazyEights) CpuChooseSuit()

CpuChooseSuit CPUがスートを選択する

### func (*CrazyEights) CpuPlay

func (g *CrazyEights) CpuPlay()

CpuPlay 現在の手番がCPUの場合に1ターン実行

### func (*CrazyEights) GetActionLog

func (g *CrazyEights) GetActionLog() []*ActionLogEntry

GetActionLog 棋譜取得

### func (*CrazyEights) GetChosenSuit

func (g *CrazyEights) GetChosenSuit() int

GetChosenSuit 選択されたスート取得 (-1 = 未選択)

### func (*CrazyEights) GetConfig

func (g *CrazyEights) GetConfig() CrazyEightsConfig

GetConfig 設定取得

### func (*CrazyEights) GetCurrentPlayerIdx

func (g *CrazyEights) GetCurrentPlayerIdx() int

GetCurrentPlayerIdx 現在のプレイヤーインデックス取得

### func (*CrazyEights) GetDiscardPile

func (g *CrazyEights) GetDiscardPile() []*Card

GetDiscardPile 捨て札の山を取得

### func (*CrazyEights) GetDiscardTop

func (g *CrazyEights) GetDiscardTop() *Card

GetDiscardTop 捨て札の一番上を取得

### func (*CrazyEights) GetDrawPileCount

func (g *CrazyEights) GetDrawPileCount() int

GetDrawPileCount 山札の残り枚数取得

### func (*CrazyEights) GetGameEndFlag

func (g *CrazyEights) GetGameEndFlag() bool

GetGameEndFlag ゲーム終了フラグ取得

### func (*CrazyEights) GetPhase

func (g *CrazyEights) GetPhase() CrazyEightsPhase

GetPhase 現在のフェーズ取得

### func (*CrazyEights) GetPlayer

func (g *CrazyEights) GetPlayer(i int) *CrazyEightsPlayer

GetPlayer プレイヤー取得

### func (*CrazyEights) GetPlayerCnt

func (g *CrazyEights) GetPlayerCnt() int

GetPlayerCnt プレイヤー数取得

### func (*CrazyEights) GetRoundNumber

func (g *CrazyEights) GetRoundNumber() int

GetRoundNumber 現在のラウンド番号取得

### func (*CrazyEights) GetValidPlayIndices

func (g *CrazyEights) GetValidPlayIndices(playerIdx int) []int

GetValidPlayIndices プレイ可能なカードのインデックスリストを返す (Web用)

### func (*CrazyEights) GetWinnerIdx

func (g *CrazyEights) GetWinnerIdx() int

GetWinnerIdx 勝者インデックス取得 (-1 = 未確定)

### func (*CrazyEights) IsHumanTurn

func (g *CrazyEights) IsHumanTurn() bool

IsHumanTurn 現在の手番が人間かどうか

### func (*CrazyEights) MarshalJSON

func (g *CrazyEights) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*CrazyEights) NextRound

func (g *CrazyEights) NextRound()

NextRound 次のラウンドを開始する

### func (*CrazyEights) PlayerChooseSuit

func (g *CrazyEights) PlayerChooseSuit(suit int) error

PlayerChooseSuit 人間プレイヤーがスートを選択する (8を出した後)

### func (*CrazyEights) PlayerDraw

func (g *CrazyEights) PlayerDraw() error

PlayerDraw 人間プレイヤーがカードを引く

### func (*CrazyEights) PlayerPlay

func (g *CrazyEights) PlayerPlay(cardIndex int) error

PlayerPlay 人間プレイヤーがカードをプレイする

### func (*CrazyEights) Reset

func (g *CrazyEights) Reset()

Reset ゲーム初期化

### func (*CrazyEights) ScoreRound

func (g *CrazyEights) ScoreRound()

ScoreRound ラウンドのスコアを確定する

### func (*CrazyEights) SetChosenSuit

func (g *CrazyEights) SetChosenSuit(suit int)

SetChosenSuit スート設定 (テスト用)

### func (*CrazyEights) SetConfig

func (g *CrazyEights) SetConfig(cfg CrazyEightsConfig)

SetConfig 設定変更

### func (*CrazyEights) SetCurrentPlayerIdx

func (g *CrazyEights) SetCurrentPlayerIdx(idx int)

SetCurrentPlayerIdx プレイヤーインデックス設定 (テスト用)

### func (*CrazyEights) SetDiscardPile

func (g *CrazyEights) SetDiscardPile(pile []*Card)

SetDiscardPile 捨て札の山を設定 (テスト用)

### func (*CrazyEights) SetDrawPile

func (g *CrazyEights) SetDrawPile(pile []*Card)

SetDrawPile 山札を設定 (テスト用)

### func (*CrazyEights) SetPhase

func (g *CrazyEights) SetPhase(phase CrazyEightsPhase)

SetPhase フェーズ設定 (テスト用)

### func (*CrazyEights) SetRoundNumber

func (g *CrazyEights) SetRoundNumber(n int)

SetRoundNumber ラウンド番号設定 (テスト用)

### func (*CrazyEights) UnmarshalJSON

func (g *CrazyEights) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type CrazyEightsConfig

CrazyEightsConfig クレイジーエイトゲーム設定

type CrazyEightsConfig struct {
    CpuDifficulty CrazyEightsCpuDifficulty `json:"cd"`
    PointLimit    int                      `json:"pl"` // ゲーム終了スコア (先に到達したプレイヤーが勝利)
}

### func DefaultCrazyEightsConfig

func DefaultCrazyEightsConfig() CrazyEightsConfig

DefaultCrazyEightsConfig デフォルト設定を返す

### func (CrazyEightsConfig) Validate

func (c CrazyEightsConfig) Validate() error

Validate 設定値のドメインバリデーション

## type CrazyEightsCpuDifficulty

CrazyEightsCpuDifficulty CPU の難易度レベル

type CrazyEightsCpuDifficulty int

CrazyEightsのCPU難易度定数

const (
    // CrazyEightsCpuDifficultyEasy 低難易度
    CrazyEightsCpuDifficultyEasy CrazyEightsCpuDifficulty = iota
    // CrazyEightsCpuDifficultyNormal 中難易度
    CrazyEightsCpuDifficultyNormal
    // CrazyEightsCpuDifficultyHard 高難易度
    CrazyEightsCpuDifficultyHard
)

## type CrazyEightsPhase

CrazyEightsPhase ゲームフェーズ

type CrazyEightsPhase int

CrazyEightsのフェーズ定数

const (
    // CrazyEightsPhasePlay 通常プレイフェーズ
    CrazyEightsPhasePlay CrazyEightsPhase = 0
    // CrazyEightsPhaseChooseSuit 8を出した後のスート選択フェーズ
    CrazyEightsPhaseChooseSuit CrazyEightsPhase = 1
    // CrazyEightsPhaseRoundEnd ラウンド終了フェーズ
    CrazyEightsPhaseRoundEnd CrazyEightsPhase = 2
    // CrazyEightsPhaseGameEnd ゲーム終了フェーズ
    CrazyEightsPhaseGameEnd CrazyEightsPhase = 3
)

## type CrazyEightsPlayer

CrazyEightsPlayer クレイジーエイトプレイヤークラス

type CrazyEightsPlayer struct {
    *GamePlayer
    RoundScoreHolder
}

### func NewCrazyEightsPlayer

func NewCrazyEightsPlayer(isHuman bool) *CrazyEightsPlayer

NewCrazyEightsPlayer コンストラクタ

### func (*CrazyEightsPlayer) MarshalJSON

func (p *CrazyEightsPlayer) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*CrazyEightsPlayer) ResetRound

func (p *CrazyEightsPlayer) ResetRound()

ResetRound ラウンドをリセット(手札・スコア・終了状態を初期化)

### func (*CrazyEightsPlayer) UnmarshalJSON

func (p *CrazyEightsPlayer) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type Cribbage

Cribbage クリベッジゲームクラス

type Cribbage struct {
    // contains filtered or unexported fields
}

### func NewCribbage

func NewCribbage(trumpCards *TrumpCards, players []*CribbagePlayer, config CribbageConfig) *Cribbage

NewCribbage コンストラクタ

### func (*Cribbage) CpuPlay

func (g *Cribbage) CpuPlay()

CpuPlay CPUのターンを自動実行

### func (*Cribbage) GetActionLog

func (g *Cribbage) GetActionLog() []*ActionLogEntry

GetActionLog アクションログ取得

### func (*Cribbage) GetConfig

func (g *Cribbage) GetConfig() CribbageConfig

GetConfig 設定取得

### func (*Cribbage) GetCrib

func (g *Cribbage) GetCrib() []*Card

GetCrib クリブ取得

### func (*Cribbage) GetCurrentPlayerIdx

func (g *Cribbage) GetCurrentPlayerIdx() int

GetCurrentPlayerIdx 現在のプレイヤーインデックス取得

### func (*Cribbage) GetDealerIdx

func (g *Cribbage) GetDealerIdx() int

GetDealerIdx ディーラーインデックス取得

### func (*Cribbage) GetGameEndFlag

func (g *Cribbage) GetGameEndFlag() bool

GetGameEndFlag ゲーム終了フラグ取得

### func (*Cribbage) GetHandScoreDetails

func (g *Cribbage) GetHandScoreDetails() [3]*CribbageScoreDetail

GetHandScoreDetails ハンドスコア詳細取得

### func (*Cribbage) GetOriginalHand

func (g *Cribbage) GetOriginalHand(playerIdx int) []*Card

GetOriginalHand ショーフェーズ用の元の手札を取得

### func (*Cribbage) GetPegCount

func (g *Cribbage) GetPegCount() int

GetPegCount ペギングカウント取得

### func (*Cribbage) GetPegPlayedCards

func (g *Cribbage) GetPegPlayedCards() []*Card

GetPegPlayedCards ペギングで出されたカード取得

### func (*Cribbage) GetPhase

func (g *Cribbage) GetPhase() CribbagePhase

GetPhase フェーズ取得

### func (*Cribbage) GetPlayer

func (g *Cribbage) GetPlayer(idx int) *CribbagePlayer

GetPlayer プレイヤー取得

### func (*Cribbage) GetPlayerPeggedCards

func (g *Cribbage) GetPlayerPeggedCards(playerIdx int) []*Card

GetPlayerPeggedCards プレイヤーがペギングで出したカードを取得

### func (*Cribbage) GetRoundNumber

func (g *Cribbage) GetRoundNumber() int

GetRoundNumber ラウンド番号取得

### func (*Cribbage) GetShowPhaseStep

func (g *Cribbage) GetShowPhaseStep() int

GetShowPhaseStep ショーフェーズのステップ取得

### func (*Cribbage) GetStarter

func (g *Cribbage) GetStarter() *Card

GetStarter スターターカード取得

### func (*Cribbage) GetWinnerIdx

func (g *Cribbage) GetWinnerIdx() int

GetWinnerIdx 勝者インデックス取得

### func (*Cribbage) IsHumanTurn

func (g *Cribbage) IsHumanTurn() bool

IsHumanTurn 人間のターンかどうか

### func (*Cribbage) MarshalJSON

func (g *Cribbage) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*Cribbage) NextRound

func (g *Cribbage) NextRound()

NextRound 次のラウンドを開始する

### func (*Cribbage) PlayerDiscard

func (g *Cribbage) PlayerDiscard(indices []int) error

PlayerDiscard 人間プレイヤーがクリブに2枚捨てる

### func (*Cribbage) PlayerGo

func (g *Cribbage) PlayerGo() error

PlayerGo 人間プレイヤーがGoを宣言

### func (*Cribbage) PlayerPeg

func (g *Cribbage) PlayerPeg(cardIndex int) error

PlayerPeg 人間プレイヤーがペギングでカードを出す

### func (*Cribbage) Reset

func (g *Cribbage) Reset()

Reset ゲーム初期化

### func (*Cribbage) SetConfig

func (g *Cribbage) SetConfig(config CribbageConfig)

SetConfig 設定変更

### func (*Cribbage) SetCrib

func (g *Cribbage) SetCrib(cards []*Card)

SetCrib テスト用: クリブを設定

### func (*Cribbage) SetCurrentPlayerIdx

func (g *Cribbage) SetCurrentPlayerIdx(idx int)

SetCurrentPlayerIdx テスト用: 現在のプレイヤーインデックスを設定

### func (*Cribbage) SetDealerIdx

func (g *Cribbage) SetDealerIdx(idx int)

SetDealerIdx テスト用: ディーラーインデックスを設定

### func (*Cribbage) SetDiscardDone

func (g *Cribbage) SetDiscardDone(playerIdx int, done bool)

SetDiscardDone テスト用: ディスカード完了フラグを設定

### func (*Cribbage) SetGameEndFlag

func (g *Cribbage) SetGameEndFlag(flag bool)

SetGameEndFlag テスト用: ゲーム終了フラグを設定

### func (*Cribbage) SetOriginalHand

func (g *Cribbage) SetOriginalHand(playerIdx int, cards []*Card)

SetOriginalHand テスト用: 元の手札を設定

### func (*Cribbage) SetPegCount

func (g *Cribbage) SetPegCount(count int)

SetPegCount テスト用: ペギングカウントを設定

### func (*Cribbage) SetPegPlayedCards

func (g *Cribbage) SetPegPlayedCards(cards []*Card)

SetPegPlayedCards テスト用: ペギングで出されたカードを設定

### func (*Cribbage) SetPhase

func (g *Cribbage) SetPhase(phase CribbagePhase)

SetPhase テスト用: フェーズを設定

### func (*Cribbage) SetStarter

func (g *Cribbage) SetStarter(card *Card)

SetStarter テスト用: スターターカードを設定

### func (*Cribbage) SetWinnerIdx

func (g *Cribbage) SetWinnerIdx(idx int)

SetWinnerIdx テスト用: 勝者インデックスを設定

### func (*Cribbage) ShowNext

func (g *Cribbage) ShowNext() error

ShowNext ショーフェーズの次のスコア計算を実行

### func (*Cribbage) UnmarshalJSON

func (g *Cribbage) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type CribbageConfig

CribbageConfig クリベッジゲーム設定

type CribbageConfig struct {
    CpuDifficulty CribbageCpuDifficulty
    PointLimit    int // ゲーム終了スコア (先に到達したプレイヤーが勝利、デフォルト121)
}

### func DefaultCribbageConfig

func DefaultCribbageConfig() CribbageConfig

DefaultCribbageConfig デフォルト設定を返す

### func (CribbageConfig) MarshalJSON

func (c CribbageConfig) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*CribbageConfig) UnmarshalJSON

func (c *CribbageConfig) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

### func (CribbageConfig) Validate

func (c CribbageConfig) Validate() error

Validate 設定値のドメインバリデーション

## type CribbageCpuDifficulty

CribbageCpuDifficulty CPU の難易度レベル

type CribbageCpuDifficulty int

CribbageのCPU難易度定数

const (
    // CribbageCpuDifficultyEasy 低難易度
    CribbageCpuDifficultyEasy CribbageCpuDifficulty = iota
    // CribbageCpuDifficultyNormal 中難易度
    CribbageCpuDifficultyNormal
    // CribbageCpuDifficultyHard 高難易度
    CribbageCpuDifficultyHard
)

## type CribbagePhase

CribbagePhase ゲームフェーズ

type CribbagePhase int

Cribbageのフェーズ定数

const (
    // CribbagePhaseDiscard 捨て札フェーズ (各プレイヤーが2枚をクリブに捨てる)
    CribbagePhaseDiscard CribbagePhase = 0
    // CribbagePhaseCut カットフェーズ (スターターカードを公開)
    CribbagePhaseCut CribbagePhase = 1
    // CribbagePhasePegging ペギングフェーズ (交互にカードを出して31を目指す)
    CribbagePhasePegging CribbagePhase = 2
    // CribbagePhaseShow ショーフェーズ (ハンド・クリブのスコアを計算)
    CribbagePhaseShow CribbagePhase = 3
    // CribbagePhaseRoundEnd ラウンド終了フェーズ
    CribbagePhaseRoundEnd CribbagePhase = 4
    // CribbagePhaseGameEnd ゲーム終了フェーズ
    CribbagePhaseGameEnd CribbagePhase = 5
)

## type CribbagePlayer

CribbagePlayer クリベッジプレイヤークラス

type CribbagePlayer struct {
    *GamePlayer
    RoundScoreHolder
}

### func NewCribbagePlayer

func NewCribbagePlayer(isHuman bool) *CribbagePlayer

NewCribbagePlayer コンストラクタ

### func (*CribbagePlayer) MarshalJSON

func (p *CribbagePlayer) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*CribbagePlayer) ResetRound

func (p *CribbagePlayer) ResetRound()

ResetRound ラウンドをリセット(手札・スコア・終了状態を初期化)

### func (*CribbagePlayer) UnmarshalJSON

func (p *CribbagePlayer) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type CribbageScoreDetail

CribbageScoreDetail クリベッジのスコア内訳

type CribbageScoreDetail struct {
    Fifteens int
    Pairs    int
    Runs     int
    Flush    int
    Nobs     int
    Total    int
    Cards    []*Card // スコア対象カード (hand + starter)
}

### func CribbageScoreHand

func CribbageScoreHand(hand []*Card, starter *Card, isCrib bool) CribbageScoreDetail

CribbageScoreHand ハンド全体のスコアを計算する

### func (CribbageScoreDetail) MarshalJSON

func (d CribbageScoreDetail) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*CribbageScoreDetail) UnmarshalJSON

func (d *CribbageScoreDetail) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type Daifugo

Daifugo 大富豪ゲームクラス

type Daifugo struct {
    // contains filtered or unexported fields
}

### func NewDaifugo

func NewDaifugo(trumpCards *TrumpCards, players []*DaifugoPlayer, config DaifugoConfig) *Daifugo

NewDaifugo コンストラクタ

### func (*Daifugo) CpuPlay

func (d *Daifugo) CpuPlay()

CpuPlay 現在の手番がCPUの場合に1ターン実行

### func (*Daifugo) GetActionLog

func (d *Daifugo) GetActionLog() []*ActionLogEntry

GetActionLog 棋譜を取得する

### func (*Daifugo) GetConfig

func (d *Daifugo) GetConfig() DaifugoConfig

GetConfig ローカルルール設定取得

### func (*Daifugo) GetCpuActions

func (d *Daifugo) GetCpuActions() []*DaifugoCpuAction

GetCpuActions CPUターンの行動履歴取得

### func (*Daifugo) GetCurrentTurn

func (d *Daifugo) GetCurrentTurn() int

GetCurrentTurn 現在の手番プレイヤーインデックス取得

### func (*Daifugo) GetElevenBackActive

func (d *Daifugo) GetElevenBackActive() bool

GetElevenBackActive 11バック発動中か取得

### func (*Daifugo) GetExchangeActions

func (d *Daifugo) GetExchangeActions() []*DaifugoExchangeAction

GetExchangeActions カード交換記録取得

### func (*Daifugo) GetGameEndFlag

func (d *Daifugo) GetGameEndFlag() bool

GetGameEndFlag ゲーム終了フラグ取得

### func (*Daifugo) GetHumanAction

func (d *Daifugo) GetHumanAction() *DaifugoCpuAction

GetHumanAction 人間の最後の行動取得

### func (*Daifugo) GetLastPlayPlayerIdx

func (d *Daifugo) GetLastPlayPlayerIdx() int

GetLastPlayPlayerIdx 最後にカードを出したプレイヤーインデックス取得 (-1 = なし)

### func (*Daifugo) GetLockedSuit

func (d *Daifugo) GetLockedSuit() int

GetLockedSuit 縛られているスート取得

### func (*Daifugo) GetNumberLocked

func (d *Daifugo) GetNumberLocked() bool

GetNumberLocked 連番縛り発動中か取得

### func (*Daifugo) GetPassCount

func (d *Daifugo) GetPassCount() int

GetPassCount 現在のパスカウント取得

### func (*Daifugo) GetPendingActionTarget

func (d *Daifugo) GetPendingActionTarget() int

GetPendingActionTarget ペンディングアクションの対象プレイヤーインデックス取得

### func (*Daifugo) GetPendingActionType

func (d *Daifugo) GetPendingActionType() DaifugoPendingAction

GetPendingActionType ペンディングアクションの種類取得

### func (*Daifugo) GetPlayer

func (d *Daifugo) GetPlayer(idx int) *DaifugoPlayer

GetPlayer プレイヤー取得

### func (*Daifugo) GetPlayerCnt

func (d *Daifugo) GetPlayerCnt() int

GetPlayerCnt プレイヤー数取得

### func (*Daifugo) GetReverseDirection

func (d *Daifugo) GetReverseDirection() bool

GetReverseDirection 9リバースの方向取得

### func (*Daifugo) GetRevolutionActive

func (d *Daifugo) GetRevolutionActive() bool

GetRevolutionActive 革命フラグ取得

### func (*Daifugo) GetSequenceLocked

func (d *Daifugo) GetSequenceLocked() bool

GetSequenceLocked 階段縛り発動中か取得

### func (*Daifugo) GetSortMode

func (d *Daifugo) GetSortMode() DaifugoSortMode

GetSortMode 手札ソートモード取得

### func (*Daifugo) GetSuitLocked

func (d *Daifugo) GetSuitLocked() bool

GetSuitLocked スート縛り発動中か取得

### func (*Daifugo) GetTableCards

func (d *Daifugo) GetTableCards() []*Card

GetTableCards 場のカード取得 (nil = クリア)

### func (*Daifugo) GetTableIsSequence

func (d *Daifugo) GetTableIsSequence() bool

GetTableIsSequence 場が階段プレイか取得

### func (*Daifugo) HasPendingAction

func (d *Daifugo) HasPendingAction() bool

HasPendingAction ペンディングアクションがあるか取得

### func (*Daifugo) IsHumanTurn

func (d *Daifugo) IsHumanTurn() bool

IsHumanTurn 現在の手番が人間かどうか

### func (*Daifugo) MarshalJSON

func (d *Daifugo) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*Daifugo) PlayerPlay

func (d *Daifugo) PlayerPlay(indices []int) error

PlayerPlay 人間プレイヤーがカードを出す (または パスする) indices: 出すカードのインデックス。空の場合はパス。

### func (*Daifugo) Reset

func (d *Daifugo) Reset()

Reset ゲーム初期化

### func (*Daifugo) SetConfig

func (d *Daifugo) SetConfig(config DaifugoConfig)

SetConfig ローカルルール設定を変更(ResetWithConfig用)

### func (*Daifugo) SortHumanHand

func (d *Daifugo) SortHumanHand(mode DaifugoSortMode) error

SortHumanHand 人間プレイヤーの手札を指定モードでソートする

### func (*Daifugo) UnmarshalJSON

func (d *Daifugo) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type DaifugoConfig

DaifugoConfig 大富豪ローカルルール設定

type DaifugoConfig struct {
    JokerCount                int                  // ジョーカー枚数 (default: 2)
    EightCutEnabled           bool                 // 8切り
    SuitLockMode              DaifugoSuitLockMode  // スート縛りモード (0=なし, 1=片縛り, 2=両縛り)
    ElevenBackEnabled         bool                 // 11バック
    SequenceEnabled           bool                 // 階段
    CardExchangeEnabled       bool                 // カード交換
    BlindExchangeEnabled      bool                 // ブラインドカード交換 (上位が弱い札ではなくランダム)
    FiveSkipEnabled           bool                 // 5飛び
    FiveSkipCount             int                  // 5飛びスキップ数 (default: 1, FiveSkipEnabled時のみ有効)
    SevenPassEnabled          bool                 // 7渡し
    TenDiscardEnabled         bool                 // 10捨て
    SpadeThreeEnabled         bool                 // スペ3返し
    CapitalFallEnabled        bool                 // 都落ち
    NineReverseEnabled        bool                 // 9リバース
    CoupDetatEnabled          bool                 // クーデター (3枚の9で革命)
    NumberLockEnabled         bool                 // 数縛り (連番縛り)
    SandstormEnabled          bool                 // 砂嵐 (3枚の3で場をクリア)
    EmperorEnabled            bool                 // エンペラー (4枚連番・全スート異なる→革命+場クリア)
    SequenceRevolutionEnabled bool                 // 階段革命 (4枚以上の階段で革命)
    SequenceLockEnabled       bool                 // 階段縛り (階段に階段を出すと以降階段のみ)
    IllegalFinishEnabled      bool                 // 反則上がり (8切り/ジョーカー/革命で上がりはペナルティ)
    QueenBomberEnabled        bool                 // 12ボンバー (Qを出したら数字を選んで全員からその数字を除去)
    CpuDifficulty             DaifugoCpuDifficulty // CPU難易度 (0=Normal, 1=Easy, 2=Hard)
}

### func DefaultDaifugoConfig

func DefaultDaifugoConfig() DaifugoConfig

DefaultDaifugoConfig デフォルトのローカルルール設定 (全て有効)

### func (DaifugoConfig) MarshalJSON

func (c DaifugoConfig) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*DaifugoConfig) UnmarshalJSON

func (c *DaifugoConfig) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

### func (DaifugoConfig) Validate

func (c DaifugoConfig) Validate() error

Validate 設定値のドメインバリデーション

## type DaifugoCpuAction

DaifugoCpuAction CPUまたは人間の1ターン分の行動記録

type DaifugoCpuAction struct {
    PlayerIdx   int     // 行動したプレイヤーインデックス
    PlayedCards []*Card // 出したカード (nil = パス)
}

### func (*DaifugoCpuAction) MarshalJSON

func (a *DaifugoCpuAction) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*DaifugoCpuAction) UnmarshalJSON

func (a *DaifugoCpuAction) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type DaifugoCpuDifficulty

DaifugoCpuDifficulty CPU難易度レベル

type DaifugoCpuDifficulty int

DaifugoCpuDifficulty定数

const (
    // DaifugoDifficultyNormal 通常難易度 (デフォルト)
    DaifugoDifficultyNormal DaifugoCpuDifficulty = 0
    // DaifugoDifficultyEasy 簡単 (単純なグリーディ)
    DaifugoDifficultyEasy DaifugoCpuDifficulty = 1
    // DaifugoDifficultyHard 難しい (ヒューリスティックAI)
    DaifugoDifficultyHard DaifugoCpuDifficulty = 2
)

## type DaifugoExchangeAction

DaifugoExchangeAction カード交換1件の記録

type DaifugoExchangeAction struct {
    FromPlayerIdx int     // 渡したプレイヤーインデックス
    ToPlayerIdx   int     // 受け取ったプレイヤーインデックス
    Cards         []*Card // 交換されたカード
}

### func (*DaifugoExchangeAction) MarshalJSON

func (a *DaifugoExchangeAction) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*DaifugoExchangeAction) UnmarshalJSON

func (a *DaifugoExchangeAction) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type DaifugoPendingAction

DaifugoPendingAction ペンディングアクションの種類

type DaifugoPendingAction int

DaifugoPendingAction定数

const (
    // DaifugoPendingNone ペンディングなし
    DaifugoPendingNone DaifugoPendingAction = 0
    // DaifugoPendingSevenPass 7渡し待ち
    DaifugoPendingSevenPass DaifugoPendingAction = 1
    // DaifugoPendingTenDiscard 10捨て待ち
    DaifugoPendingTenDiscard DaifugoPendingAction = 2
    // DaifugoPendingQueenBomber 12ボンバー待ち
    DaifugoPendingQueenBomber DaifugoPendingAction = 3
)

## type DaifugoPlayer

DaifugoPlayer 大富豪プレイヤークラス

type DaifugoPlayer struct {
    *RankedGamePlayer
    // contains filtered or unexported fields
}

### func NewDaifugoPlayer

func NewDaifugoPlayer(isHuman bool) *DaifugoPlayer

NewDaifugoPlayer コンストラクタ

### func (*DaifugoPlayer) CountCardsByValue

func (p *DaifugoPlayer) CountCardsByValue(value int) int

CountCardsByValue 指定した値のカードの枚数を返す

### func (*DaifugoPlayer) GetIllegalFinishPenalty

func (p *DaifugoPlayer) GetIllegalFinishPenalty() bool

GetIllegalFinishPenalty 反則上がりペナルティ取得

### func (*DaifugoPlayer) GetPrevRank

func (p *DaifugoPlayer) GetPrevRank() int

GetPrevRank 前回のランク取得 (-1 = なし)

### func (*DaifugoPlayer) MarshalJSON

func (p *DaifugoPlayer) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*DaifugoPlayer) RemoveCardsByValue

func (p *DaifugoPlayer) RemoveCardsByValue(value int) []*Card

RemoveCardsByValue 指定した値のカードを全て除去して返す

### func (*DaifugoPlayer) SetIllegalFinishPenalty

func (p *DaifugoPlayer) SetIllegalFinishPenalty(v bool)

SetIllegalFinishPenalty 反則上がりペナルティ設定

### func (*DaifugoPlayer) SetPrevRank

func (p *DaifugoPlayer) SetPrevRank(r int)

SetPrevRank 前回のランク設定

### func (*DaifugoPlayer) SortCards

func (p *DaifugoPlayer) SortCards()

SortCards カードを大富豪の通常ルールに従った強さ順 (弱い順) にソート

### func (*DaifugoPlayer) SortCardsByStrength

func (p *DaifugoPlayer) SortCardsByStrength(strengthFn func(*Card) int)

SortCardsByStrength カードを指定強さ関数で弱い順にソート

### func (*DaifugoPlayer) UnmarshalJSON

func (p *DaifugoPlayer) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type DaifugoSortMode

DaifugoSortMode 手札ソートモード

type DaifugoSortMode int

DaifugoSortMode定数

const (
    // DaifugoSortByStrength 強さ順 (デフォルト)
    DaifugoSortByStrength DaifugoSortMode = 0
    // DaifugoSortBySuit スート順
    DaifugoSortBySuit DaifugoSortMode = 1
    // DaifugoSortByNumber 数字順
    DaifugoSortByNumber DaifugoSortMode = 2
)

## type DaifugoSuitLockMode

DaifugoSuitLockMode スート縛りモード

type DaifugoSuitLockMode int

DaifugoSuitLockMode定数

const (
    // DaifugoSuitLockNone スート縛りなし
    DaifugoSuitLockNone DaifugoSuitLockMode = 0
    // DaifugoSuitLockPartial 片縛り (少なくとも1枚がスート一致)
    DaifugoSuitLockPartial DaifugoSuitLockMode = 1
    // DaifugoSuitLockFull 両縛り (全てスート一致)
    DaifugoSuitLockFull DaifugoSuitLockMode = 2
)

## type DomainError

DomainError wraps a sentinel error with a user-facing message. Error() returns only the user-facing message, while Unwrap() returns the sentinel so that errors.Is() works for programmatic checks.

type DomainError struct {
    Sentinel error
    Message  string
}

### func NewDomainError

func NewDomainError(sentinel error, message string) *DomainError

NewDomainError creates a DomainError wrapping the given sentinel.

### func (*DomainError) Error

func (de *DomainError) Error() string

Error returns the user-facing message without the sentinel prefix.

### func (*DomainError) Unwrap

func (de *DomainError) Unwrap() error

Unwrap returns the sentinel error for use with errors.Is().

## type Doubt

Doubt ダウトゲームクラス

type Doubt struct {
    // contains filtered or unexported fields
}

### func NewDoubt

func NewDoubt(trumpCards *TrumpCards, players []*DoubtPlayer) *Doubt

NewDoubt コンストラクタ

### func (*Doubt) CpuPlay

func (d *Doubt) CpuPlay()

CpuPlay 現在の手番がCPUの場合に1ターン実行

### func (*Doubt) ExportProfile

func (d *Doubt) ExportProfile() interface{}

ExportProfile メタAIプロファイルをエクスポートする (プロファイルがない場合はnil)

### func (*Doubt) GetActionLog

func (d *Doubt) GetActionLog() []*ActionLogEntry

GetActionLog 棋譜を取得する

### func (*Doubt) GetConfig

func (d *Doubt) GetConfig() DoubtConfig

GetConfig ゲーム設定取得

### func (*Doubt) GetCpuActions

func (d *Doubt) GetCpuActions() []*DoubtCpuAction

GetCpuActions CPUターンの行動履歴取得

### func (*Doubt) GetCpuDoubters

func (d *Doubt) GetCpuDoubters() []int

GetCpuDoubters CPUダウターインデックスリスト取得

### func (*Doubt) GetCurrentTurn

func (d *Doubt) GetCurrentTurn() int

GetCurrentTurn 現在の手番プレイヤーインデックス取得

### func (*Doubt) GetGameEndFlag

func (d *Doubt) GetGameEndFlag() bool

GetGameEndFlag ゲーム終了フラグ取得

### func (*Doubt) GetHumanAction

func (d *Doubt) GetHumanAction() *DoubtCpuAction

GetHumanAction 人間の最後の行動取得

### func (*Doubt) GetHumanProfile

func (d *Doubt) GetHumanProfile() *DoubtHumanProfile

GetHumanProfile メタAIプロファイル取得

### func (*Doubt) GetLastAction

func (d *Doubt) GetLastAction() *DoubtAction

GetLastAction 最後のプレイアクション取得

### func (*Doubt) GetLastDoubtResult

func (d *Doubt) GetLastDoubtResult() *DoubtDoubtResult

GetLastDoubtResult 最後のダウト結果取得

### func (*Doubt) GetPhase

func (d *Doubt) GetPhase() DoubtPhase

GetPhase 現在のフェーズ取得

### func (*Doubt) GetPlayer

func (d *Doubt) GetPlayer(i int) *DoubtPlayer

GetPlayer プレイヤー取得

### func (*Doubt) GetPlayerCnt

func (d *Doubt) GetPlayerCnt() int

GetPlayerCnt プレイヤー数取得

### func (*Doubt) GetTableCardCount

func (d *Doubt) GetTableCardCount() int

GetTableCardCount テーブルカード枚数取得

### func (*Doubt) GetTableCards

func (d *Doubt) GetTableCards() []*Card

GetTableCards テーブルカード取得

### func (*Doubt) GetTurnCounter

func (d *Doubt) GetTurnCounter() int

GetTurnCounter ターンカウンター取得

### func (*Doubt) GetWinnerIdx

func (d *Doubt) GetWinnerIdx() int

GetWinnerIdx 勝者インデックス取得 (-1 = まだ決まっていない)

### func (*Doubt) ImportProfile

func (d *Doubt) ImportProfile(data []byte) error

ImportProfile JSONバイトからメタAIプロファイルをインポートする

### func (*Doubt) IsHumanTurn

func (d *Doubt) IsHumanTurn() bool

IsHumanTurn 現在の手番が人間かどうか

### func (*Doubt) MarshalJSON

func (d *Doubt) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*Doubt) PlayerPlay

func (d *Doubt) PlayerPlay(cardIndices []int, claimedValue int, humanPlayMs int) error

PlayerPlay 人間プレイヤーがカードを出す cardIndices: 出すカードのインデックス, claimedValue: 宣言する値 (1-13), humanPlayMs: 迷い時間(ms, 0=計測なし)

### func (*Doubt) Reset

func (d *Doubt) Reset()

Reset ゲーム初期化: シャッフルして各プレイヤーに均等配布

### func (*Doubt) ResetProfile

func (d *Doubt) ResetProfile()

ResetProfile メタAIプロファイルをリセットする

### func (*Doubt) ResolveDoubt

func (d *Doubt) ResolveDoubt(doubterIndices []int)

ResolveDoubt ダウト解決: 最優先 doubter がカードを公開し、負けた方がテーブルカードを引き取る doubterIndices: ダウトしたプレイヤーインデックスのリスト (人間 + CPU)

### func (*Doubt) SetConfig

func (d *Doubt) SetConfig(cfg DoubtConfig)

SetConfig ゲーム設定変更

### func (*Doubt) SkipDoubt

func (d *Doubt) SkipDoubt()

SkipDoubt ダウトをスキップ: テーブルカードはそのまま残り、手番が進む

### func (*Doubt) UnmarshalJSON

func (d *Doubt) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type DoubtAction

DoubtAction プレイヤーが出したカードの情報 (実際のカードを含む)

type DoubtAction struct {
    PlayerIdx    int     // 出したプレイヤーインデックス
    ClaimedValue int     // 宣言した値 (1-13)
    CardCount    int     // 出した枚数
    PlayedCards  []*Card // 実際に出したカード (ダウト時に公開)
}

### func (*DoubtAction) MarshalJSON

func (a *DoubtAction) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*DoubtAction) UnmarshalJSON

func (a *DoubtAction) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type DoubtConfig

DoubtConfig ダウトゲーム設定

type DoubtConfig struct {
    DoubtWindowSec       int
    CpuMemoryLevel       DoubtMemoryLevel
    PenaltyDrawLimit     int  // 0 = unlimited; >0 = loser draws at most N cards
    CpuHesitationEnabled bool // CPU迷い時間ディレイ
    CpuMetaAI            bool // メタAI: セッション内学習
}

### func DefaultDoubtConfig

func DefaultDoubtConfig() DoubtConfig

DefaultDoubtConfig デフォルト設定を返す

### func (DoubtConfig) MarshalJSON

func (c DoubtConfig) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*DoubtConfig) UnmarshalJSON

func (c *DoubtConfig) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type DoubtCpuAction

DoubtCpuAction 1ターン分の行動記録 (表示用; 実際のカードは含まない)

type DoubtCpuAction struct {
    PlayerIdx    int  // 行動したプレイヤーインデックス
    ClaimedValue int  // 宣言した値
    CardCount    int  // 出した枚数
    IsBluff      bool // ブラフかどうか (CPU のみ追跡)
    HasTell      bool // テル(緊張の兆候)を見せているか
    HesitationMs int  // 迷い時間ディレイ (ミリ秒; 0=無効)
}

### func (*DoubtCpuAction) MarshalJSON

func (a *DoubtCpuAction) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*DoubtCpuAction) UnmarshalJSON

func (a *DoubtCpuAction) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type DoubtDoubtResult

DoubtDoubtResult ダウト解決結果

type DoubtDoubtResult struct {
    DoubterIdx     int     // ダウトしたプレイヤーインデックス
    CardPlayerIdx  int     // カードを出したプレイヤーインデックス
    WasLying       bool    // カードを出したプレイヤーが嘘をついていたか
    LoserIdx       int     // 負けたプレイヤーインデックス (テーブルカードを引き取る)
    CardCount      int     // 引き取ったカード枚数
    DiscardedCount int     // ペナルティ上限超過で除外されたカード枚数
    RevealedCards  []*Card // 公開されたカード
}

### func (*DoubtDoubtResult) MarshalJSON

func (r *DoubtDoubtResult) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*DoubtDoubtResult) UnmarshalJSON

func (r *DoubtDoubtResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type DoubtHumanProfile

DoubtHumanProfile セッション内で人間プレイヤーの行動を学習するプロファイル

type DoubtHumanProfile struct {
    // BluffsByBracket 手札枚数ブラケット別のブラフ追跡: [0]=小(1-4), [1]=中(5-9), [2]=大(10+)
    BluffsByBracket [3]struct{ Bluffs, Total int }
    // DoubtCorrect 人間のダウト成功回数
    DoubtCorrect int
    // DoubtTotal 人間のダウト合計回数
    DoubtTotal int
    // GamesPlayed セッション内のゲーム数
    GamesPlayed int
    // HesitationCount 迷い時間の計測回数 (Welford's online algorithm)
    HesitationCount int
    // HesitationMean 迷い時間の平均 (ms)
    HesitationMean float64
    // HesitationM2 迷い時間の分散計算用 M2 (Welford's online algorithm)
    HesitationM2 float64
}

### func (*DoubtHumanProfile) AdaptStrength

func (p *DoubtHumanProfile) AdaptStrength() float64

AdaptStrength 適応強度を返す (0.0 ~ 0.2)

### func (*DoubtHumanProfile) AdjustedBluffChance

func (p *DoubtHumanProfile) AdjustedBluffChance(base float64) float64

AdjustedBluffChance 人間のダウト正解率に基づいて調整済みブラフ確率を返す

### func (*DoubtHumanProfile) AdjustedDoubtChance

func (p *DoubtHumanProfile) AdjustedDoubtChance(base float64, bracket int, humanPlayMs int) float64

AdjustedDoubtChance ブラフ率と迷い時間に基づいて調整済みダウト確率を返す

### func (*DoubtHumanProfile) BluffRate

func (p *DoubtHumanProfile) BluffRate(bracket int) float64

BluffRate 指定ブラケットのブラフ率を返す (データなしの場合0.5)

### func (*DoubtHumanProfile) DoubtAccuracy

func (p *DoubtHumanProfile) DoubtAccuracy() float64

DoubtAccuracy 人間のダウト正解率を返す (データなしの場合0.5)

### func (*DoubtHumanProfile) Export

func (p *DoubtHumanProfile) Export() DoubtHumanProfileData

Export プロファイルデータをJSON永続化形式でエクスポートする

### func (*DoubtHumanProfile) HesitationBoost

func (p *DoubtHumanProfile) HesitationBoost(ms int) float64

HesitationBoost 指定msの迷い時間に対するダウト確率ブーストを返す

### func (*DoubtHumanProfile) HesitationStdDev

func (p *DoubtHumanProfile) HesitationStdDev() float64

HesitationStdDev 迷い時間の標準偏差を返す (データ不足の場合0)

### func (*DoubtHumanProfile) HesitationZScore

func (p *DoubtHumanProfile) HesitationZScore(ms int) float64

HesitationZScore 指定msの迷い時間のz-scoreを返す (データ不足の場合0)

### func (*DoubtHumanProfile) Import

func (p *DoubtHumanProfile) Import(data DoubtHumanProfileData)

Import JSON永続化形式のデータからプロファイルを復元する

### func (*DoubtHumanProfile) RecordDoubt

func (p *DoubtHumanProfile) RecordDoubt(wasCorrect bool)

RecordDoubt ダウト結果を記録する

### func (*DoubtHumanProfile) RecordHesitation

func (p *DoubtHumanProfile) RecordHesitation(ms int)

RecordHesitation 迷い時間(ms)を記録する (Welford’s online algorithm) ms <= 0 の場合は何もしない (CUI等で計測不可の場合)

### func (*DoubtHumanProfile) RecordPlay

func (p *DoubtHumanProfile) RecordPlay(handSize int, isBluff bool)

RecordPlay カードプレイを記録する

## type DoubtHumanProfileBracketData

DoubtHumanProfileBracketData はブラケット別ブラフ行動のJSON出力形式

type DoubtHumanProfileBracketData struct {
    Bluffs int `json:"bluffs"`
    Total  int `json:"total"`
}

## type DoubtHumanProfileData

DoubtHumanProfileData はDoubtHumanProfileのJSON永続化形式

type DoubtHumanProfileData struct {
    BluffsByBracket [3]DoubtHumanProfileBracketData `json:"bluffsByBracket"`
    DoubtCorrect    int                             `json:"doubtCorrect"`
    DoubtTotal      int                             `json:"doubtTotal"`
    GamesPlayed     int                             `json:"gamesPlayed"`
    HesitationCount int                             `json:"hesitationCount"`
    HesitationMean  float64                         `json:"hesitationMean"`
    HesitationM2    float64                         `json:"hesitationM2"`
}

### func ImportDoubtHumanProfileJSON

func ImportDoubtHumanProfileJSON(data []byte) (DoubtHumanProfileData, error)

ImportDoubtHumanProfileJSON JSONバイトからDoubtHumanProfileDataをデコードする

## type DoubtMemoryLevel

DoubtMemoryLevel CPU の記憶力レベル

type DoubtMemoryLevel int

Doubtの記憶レベル定数

const (
    // DoubtMemoryLevelEasy 低記憶力 (約30%の確率で記憶)
    DoubtMemoryLevelEasy DoubtMemoryLevel = iota
    // DoubtMemoryLevelNormal 中記憶力 (約70%の確率で記憶)
    DoubtMemoryLevelNormal
    // DoubtMemoryLevelHard 高記憶力 (100%記憶)
    DoubtMemoryLevelHard
)

## type DoubtPhase

DoubtPhase ゲームフェーズ

type DoubtPhase int

Doubtのフェーズ定数

const (
    // DoubtPhasePlay プレイフェーズ (カードを出す番)
    DoubtPhasePlay DoubtPhase = 0
    // DoubtPhaseDoubt ダウトフェーズ (ダウトするか判断する番)
    DoubtPhaseDoubt DoubtPhase = 1
    // DoubtPhaseEnd ゲーム終了フェーズ
    DoubtPhaseEnd DoubtPhase = 2
)

## type DoubtPlayer

DoubtPlayer ダウトプレイヤークラス

type DoubtPlayer struct {
    *GamePlayer
    // contains filtered or unexported fields
}

### func NewDoubtPlayer

func NewDoubtPlayer(isHuman bool) *DoubtPlayer

NewDoubtPlayer コンストラクタ

### func (*DoubtPlayer) CountKnownCards

func (p *DoubtPlayer) CountKnownCards(value int) int

CountKnownCards 指定した値のカードを何枚知っているか返す (記憶 + 手札)

### func (*DoubtPlayer) MarshalJSON

func (p *DoubtPlayer) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*DoubtPlayer) RecordRevealedCard

func (p *DoubtPlayer) RecordRevealedCard(value int, retentionChance float64, turnNumber int)

RecordRevealedCard 公開されたカードを記憶する (retentionChance の確率で記録)

### func (*DoubtPlayer) UnmarshalJSON

func (p *DoubtPlayer) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type Euchre

Euchre ユーカーゲームクラス

type Euchre struct {
    // contains filtered or unexported fields
}

### func NewEuchre

func NewEuchre(trumpCards *TrumpCards, players []*EuchrePlayer, config EuchreConfig) *Euchre

NewEuchre コンストラクタ

### func (*Euchre) CardRankPublic

func (e *Euchre) CardRankPublic(card *Card) int

CardRankPublic カードランク取得 (テスト用公開メソッド)

### func (*Euchre) CpuCallTrump

func (e *Euchre) CpuCallTrump()

CpuCallTrump CPUプレイヤーがコールトランプ判断する

### func (*Euchre) CpuDiscard

func (e *Euchre) CpuDiscard()

CpuDiscard CPUプレイヤー(ディーラー)がカードを1枚捨てる

### func (*Euchre) CpuPickUp

func (e *Euchre) CpuPickUp()

CpuPickUp CPUプレイヤーがピックアップ判断する

### func (*Euchre) CpuPlay

func (e *Euchre) CpuPlay()

CpuPlay CPUプレイヤーが1ターン実行

### func (*Euchre) EffectiveSuitPublic

func (e *Euchre) EffectiveSuitPublic(card *Card) int

EffectiveSuitPublic 実効スート取得 (テスト用公開メソッド)

### func (*Euchre) GetActionLog

func (e *Euchre) GetActionLog() []*ActionLogEntry

GetActionLog 棋譜取得

### func (*Euchre) GetBidPlayerIdx

func (e *Euchre) GetBidPlayerIdx() int

GetBidPlayerIdx ビッドプレイヤーインデックス取得

### func (*Euchre) GetConfig

func (e *Euchre) GetConfig() EuchreConfig

GetConfig 設定取得

### func (*Euchre) GetCurrentPlayerIdx

func (e *Euchre) GetCurrentPlayerIdx() int

GetCurrentPlayerIdx 現在のプレイヤーインデックス取得

### func (*Euchre) GetCurrentTrick

func (e *Euchre) GetCurrentTrick() []*EuchreTrickCard

GetCurrentTrick 現在のトリック取得

### func (*Euchre) GetDealerIdx

func (e *Euchre) GetDealerIdx() int

GetDealerIdx ディーラーインデックス取得

### func (*Euchre) GetFaceUpCard

func (e *Euchre) GetFaceUpCard() *Card

GetFaceUpCard 表向きカード取得 (nil = ピックアップ済み)

### func (*Euchre) GetGameEndFlag

func (e *Euchre) GetGameEndFlag() bool

GetGameEndFlag ゲーム終了フラグ取得

### func (*Euchre) GetGoingAlone

func (e *Euchre) GetGoingAlone() bool

GetGoingAlone ゴーアローン状態取得

### func (*Euchre) GetGoingAlonePlayerIdx

func (e *Euchre) GetGoingAlonePlayerIdx() int

GetGoingAlonePlayerIdx ゴーアローンプレイヤーインデックス取得

### func (*Euchre) GetHint

func (e *Euchre) GetHint() *EuchreHint

GetHint ヒントを取得する

### func (*Euchre) GetKitty

func (e *Euchre) GetKitty() []*Card

GetKitty キティ取得

### func (*Euchre) GetLeadPlayerIdx

func (e *Euchre) GetLeadPlayerIdx() int

GetLeadPlayerIdx リードプレイヤーインデックス取得

### func (*Euchre) GetMakerTeam

func (e *Euchre) GetMakerTeam() int

GetMakerTeam メイカーチーム取得

### func (*Euchre) GetPhase

func (e *Euchre) GetPhase() EuchrePhase

GetPhase 現在のフェーズ取得

### func (*Euchre) GetPlayer

func (e *Euchre) GetPlayer(i int) *EuchrePlayer

GetPlayer プレイヤー取得

### func (*Euchre) GetPlayerCnt

func (e *Euchre) GetPlayerCnt() int

GetPlayerCnt プレイヤー数取得

### func (*Euchre) GetRoundNumber

func (e *Euchre) GetRoundNumber() int

GetRoundNumber 現在のラウンド番号取得

### func (*Euchre) GetTeamScore

func (e *Euchre) GetTeamScore(team int) int

GetTeamScore チームスコア取得

### func (*Euchre) GetTrickNumber

func (e *Euchre) GetTrickNumber() int

GetTrickNumber 現在のトリック番号取得

### func (*Euchre) GetTrumpSuit

func (e *Euchre) GetTrumpSuit() int

GetTrumpSuit 切り札スート取得

### func (*Euchre) GetValidPlayIndices

func (e *Euchre) GetValidPlayIndices(playerIdx int) []int

GetValidPlayIndices プレイ可能なカードのインデックスリストを返す (Web用)

### func (*Euchre) GetWinnerTeam

func (e *Euchre) GetWinnerTeam() int

GetWinnerTeam 勝利チーム取得 (-1 = 未確定)

### func (*Euchre) IsHumanBidTurn

func (e *Euchre) IsHumanBidTurn() bool

IsHumanBidTurn 現在のビッド手番が人間かどうか

### func (*Euchre) IsHumanTurn

func (e *Euchre) IsHumanTurn() bool

IsHumanTurn 現在の手番が人間かどうか

### func (*Euchre) MarshalJSON

func (e *Euchre) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*Euchre) NextRound

func (e *Euchre) NextRound()

NextRound 次のラウンドを開始する

### func (*Euchre) NextTrick

func (e *Euchre) NextTrick()

NextTrick 次のトリックを開始する

### func (*Euchre) PlayerCallTrump

func (e *Euchre) PlayerCallTrump(suit int, goAlone bool) error

PlayerCallTrump 人間プレイヤーがスートを指名する

### func (*Euchre) PlayerDiscard

func (e *Euchre) PlayerDiscard(cardIndex int) error

PlayerDiscard 人間プレイヤー(ディーラー)がカードを1枚捨てる

### func (*Euchre) PlayerPassCall

func (e *Euchre) PlayerPassCall() error

PlayerPassCall 人間プレイヤーがコールフェーズでパスする

### func (*Euchre) PlayerPickUp

func (e *Euchre) PlayerPickUp(orderUp bool, goAlone bool) error

PlayerPickUp 人間プレイヤーがピックアップ判断する

### func (*Euchre) PlayerPlay

func (e *Euchre) PlayerPlay(cardIndex int) error

PlayerPlay 人間プレイヤーがカードをプレイする

### func (*Euchre) Reset

func (e *Euchre) Reset()

Reset ゲーム初期化

### func (*Euchre) ResolveTrick

func (e *Euchre) ResolveTrick()

ResolveTrick トリックを解決して勝者を決定する

### func (*Euchre) ScoreRound

func (e *Euchre) ScoreRound()

ScoreRound ラウンドのスコアを確定し、ゲーム終了判定を行う

### func (*Euchre) SetBidPlayerIdx

func (e *Euchre) SetBidPlayerIdx(idx int)

SetBidPlayerIdx ビッドプレイヤーインデックス設定 (テスト用)

### func (*Euchre) SetConfig

func (e *Euchre) SetConfig(cfg EuchreConfig)

SetConfig 設定変更

### func (*Euchre) SetCurrentPlayerIdx

func (e *Euchre) SetCurrentPlayerIdx(idx int)

SetCurrentPlayerIdx プレイヤーインデックス設定 (テスト用)

### func (*Euchre) SetCurrentTrick

func (e *Euchre) SetCurrentTrick(trick []*EuchreTrickCard)

SetCurrentTrick トリック設定 (テスト用)

### func (*Euchre) SetDealerIdx

func (e *Euchre) SetDealerIdx(idx int)

SetDealerIdx ディーラーインデックス設定 (テスト用)

### func (*Euchre) SetFaceUpCard

func (e *Euchre) SetFaceUpCard(card *Card)

SetFaceUpCard 表向きカード設定 (テスト用)

### func (*Euchre) SetGoingAlone

func (e *Euchre) SetGoingAlone(alone bool)

SetGoingAlone ゴーアローン設定 (テスト用)

### func (*Euchre) SetGoingAlonePlayerIdx

func (e *Euchre) SetGoingAlonePlayerIdx(idx int)

SetGoingAlonePlayerIdx ゴーアローンプレイヤーインデックス設定 (テスト用)

### func (*Euchre) SetLeadPlayerIdx

func (e *Euchre) SetLeadPlayerIdx(idx int)

SetLeadPlayerIdx リードプレイヤーインデックス設定 (テスト用)

### func (*Euchre) SetMakerTeam

func (e *Euchre) SetMakerTeam(team int)

SetMakerTeam メイカーチーム設定 (テスト用)

### func (*Euchre) SetPhase

func (e *Euchre) SetPhase(phase EuchrePhase)

SetPhase フェーズ設定 (テスト用)

### func (*Euchre) SetRoundNumber

func (e *Euchre) SetRoundNumber(n int)

SetRoundNumber ラウンド番号設定 (テスト用)

### func (*Euchre) SetTeamScore

func (e *Euchre) SetTeamScore(team, score int)

SetTeamScore チームスコア設定 (テスト用)

### func (*Euchre) SetTrickNumber

func (e *Euchre) SetTrickNumber(n int)

SetTrickNumber トリック番号設定 (テスト用)

### func (*Euchre) SetTrumpSuit

func (e *Euchre) SetTrumpSuit(suit int)

SetTrumpSuit 切り札スート設定 (テスト用)

### func (*Euchre) UnmarshalJSON

func (e *Euchre) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type EuchreConfig

EuchreConfig ユーカーゲーム設定

type EuchreConfig struct {
    CpuDifficulty EuchreCpuDifficulty `json:"cd"`
    PointLimit    int                 `json:"pl"` // ゲーム終了スコア (先に到達したチームが勝利, デフォルト10)
}

### func DefaultEuchreConfig

func DefaultEuchreConfig() EuchreConfig

DefaultEuchreConfig デフォルト設定を返す

### func (EuchreConfig) Validate

func (c EuchreConfig) Validate() error

Validate 設定値のドメインバリデーション

## type EuchreCpuDifficulty

EuchreCpuDifficulty CPU の難易度レベル

type EuchreCpuDifficulty int

EuchreのCPU難易度定数

const (
    // EuchreCpuDifficultyEasy 低難易度
    EuchreCpuDifficultyEasy EuchreCpuDifficulty = iota
    // EuchreCpuDifficultyNormal 中難易度
    EuchreCpuDifficultyNormal
    // EuchreCpuDifficultyHard 高難易度
    EuchreCpuDifficultyHard
)

## type EuchreHint

EuchreHint ヒント情報

type EuchreHint struct {
    CardIndex *int   // 推奨カードインデックス (プレイ/ディスカード時)
    OrderUp   *bool  // ピックアップすべきか
    Suit      *int   // 推奨スート (コールトランプ時)
    GoAlone   *bool  // ゴーアローンすべきか
    Reason    string // ヒント理由キー
}

## type EuchrePhase

EuchrePhase ゲームフェーズ

type EuchrePhase int

Euchreのフェーズ定数

const (
    // EuchrePhasePickUp ピックアップフェーズ (ラウンド1: 表向きカードのスートを切り札に指名するか)
    EuchrePhasePickUp EuchrePhase = 0
    // EuchrePhaseCallTrump コールトランプフェーズ (ラウンド2: 別のスートを切り札に指名するか)
    EuchrePhaseCallTrump EuchrePhase = 1
    // EuchrePhaseDiscard ディスカードフェーズ (ディーラーがカードを1枚捨てる)
    EuchrePhaseDiscard EuchrePhase = 2
    // EuchrePhasePlay トリックプレイフェーズ
    EuchrePhasePlay EuchrePhase = 3
    // EuchrePhaseTrickEnd トリック終了フェーズ
    EuchrePhaseTrickEnd EuchrePhase = 4
    // EuchrePhaseRoundEnd ラウンド終了フェーズ
    EuchrePhaseRoundEnd EuchrePhase = 5
    // EuchrePhaseGameEnd ゲーム終了フェーズ
    EuchrePhaseGameEnd EuchrePhase = 6
)

## type EuchrePlayer

EuchrePlayer ユーカープレイヤークラス

type EuchrePlayer struct {
    *GamePlayer
    TrickHolder
    // contains filtered or unexported fields
}

### func NewEuchrePlayer

func NewEuchrePlayer(isHuman bool, team int) *EuchrePlayer

NewEuchrePlayer コンストラクタ

### func (*EuchrePlayer) GetTeam

func (p *EuchrePlayer) GetTeam() int

GetTeam チームインデックスを取得

### func (*EuchrePlayer) MarshalJSON

func (p *EuchrePlayer) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*EuchrePlayer) ResetRound

func (p *EuchrePlayer) ResetRound()

ResetRound ラウンドをリセット(トリック・手札・終了状態を初期化)

### func (*EuchrePlayer) UnmarshalJSON

func (p *EuchrePlayer) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type EuchreTrickCard

EuchreTrickCard トリック中の1枚

type EuchreTrickCard struct {
    PlayerIdx int   `json:"pi"`
    Card      *Card `json:"c"`
}

## type FreeCell

FreeCell フリーセルゲームクラス

type FreeCell struct {
    // contains filtered or unexported fields
}

### func NewFreeCell

func NewFreeCell(trumpCards *TrumpCards) *FreeCell

NewFreeCell コンストラクタ

### func (*FreeCell) AutoComplete

func (f *FreeCell) AutoComplete() error

AutoComplete オートコンプリート

### func (*FreeCell) CanUndo

func (f *FreeCell) CanUndo() bool

CanUndo アンドゥ可能かどうか

### func (*FreeCell) GetActionLog

func (f *FreeCell) GetActionLog() []*ActionLogEntry

GetActionLog 棋譜取得

### func (*FreeCell) GetFoundation

func (f *FreeCell) GetFoundation() [FreeCellFoundationCnt][]*Card

GetFoundation ファンデーション取得

### func (*FreeCell) GetFreeCells

func (f *FreeCell) GetFreeCells() [FreeCellCellCnt]*Card

GetFreeCells フリーセル取得

### func (*FreeCell) GetHint

func (f *FreeCell) GetHint() *FreeCellHint

GetHint ヒントを取得

### func (*FreeCell) GetMoveCount

func (f *FreeCell) GetMoveCount() int

GetMoveCount 移動回数取得

### func (*FreeCell) GetPhase

func (f *FreeCell) GetPhase() FreeCellPhase

GetPhase フェーズ取得

### func (*FreeCell) GetTableau

func (f *FreeCell) GetTableau() [FreeCellTableauCnt][]*Card

GetTableau タブロー取得

### func (*FreeCell) GiveUp

func (f *FreeCell) GiveUp()

GiveUp ギブアップ

### func (*FreeCell) IsStalemate

func (f *FreeCell) IsStalemate() bool

IsStalemate 手詰まり状態取得

### func (*FreeCell) MarshalJSON

func (f *FreeCell) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*FreeCell) MoveFreeCellToFoundation

func (f *FreeCell) MoveFreeCellToFoundation(cell int) error

MoveFreeCellToFoundation フリーセルからファンデーションにカードを移動

### func (*FreeCell) MoveFreeCellToTableau

func (f *FreeCell) MoveFreeCellToTableau(cell, col int) error

MoveFreeCellToTableau フリーセルからタブローにカードを移動

### func (*FreeCell) MoveTableauToFoundation

func (f *FreeCell) MoveTableauToFoundation(col int) error

MoveTableauToFoundation タブローからファンデーションにカードを移動

### func (*FreeCell) MoveTableauToFreeCell

func (f *FreeCell) MoveTableauToFreeCell(col, cell int) error

MoveTableauToFreeCell タブローからフリーセルにカードを移動

### func (*FreeCell) MoveTableauToTableau

func (f *FreeCell) MoveTableauToTableau(fromCol, cardIndex, toCol int) error

MoveTableauToTableau タブローからタブローにカードを移動(スーパームーブ対応)

### func (*FreeCell) Reset

func (f *FreeCell) Reset()

Reset ゲームリセット

### func (*FreeCell) SetFoundation

func (f *FreeCell) SetFoundation(foundation [FreeCellFoundationCnt][]*Card)

SetFoundation ファンデーション設定 (テスト用)

### func (*FreeCell) SetFreeCells

func (f *FreeCell) SetFreeCells(cells [FreeCellCellCnt]*Card)

SetFreeCells フリーセル設定 (テスト用)

### func (*FreeCell) SetIsStalemate

func (f *FreeCell) SetIsStalemate(v bool)

SetIsStalemate 手詰まり状態設定 (テスト用)

### func (*FreeCell) SetPhase

func (f *FreeCell) SetPhase(phase FreeCellPhase)

SetPhase フェーズ設定 (テスト用)

### func (*FreeCell) SetTableau

func (f *FreeCell) SetTableau(tableau [FreeCellTableauCnt][]*Card)

SetTableau タブロー設定 (テスト用)

### func (*FreeCell) Undo

func (f *FreeCell) Undo() error

Undo 直前の操作を取り消す

### func (*FreeCell) UndoN

func (f *FreeCell) UndoN(n int) error

UndoN n回連続でアンドゥを実行する。

### func (*FreeCell) UndoToEscape

func (f *FreeCell) UndoToEscape() int

UndoToEscape 膠着状態から抜けるために必要なアンドゥ回数を返す。膠着状態でなければ0、脱出不可なら-1。

### func (*FreeCell) UnmarshalJSON

func (f *FreeCell) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type FreeCellHint

FreeCellHint ヒント

type FreeCellHint struct {
    FromZone  string // "tableau" or "freecell"
    FromCol   int
    CardIndex int
    ToZone    string // "tableau", "foundation", or "freecell"
    ToCol     int
}

## type FreeCellPhase

FreeCellPhase フリーセルゲームフェーズ

type FreeCellPhase int

FreeCellのフェーズ定数

const (
    // FreeCellPhasePlaying プレイ中
    FreeCellPhasePlaying FreeCellPhase = iota
    // FreeCellPhaseGameClear ゲームクリア
    FreeCellPhaseGameClear
    // FreeCellPhaseGameOver ゲームオーバー
    FreeCellPhaseGameOver
)

## type GamePlayer

GamePlayer isHuman/isFinished を持つプレイヤー共通構造体

type GamePlayer struct {
    Player
    // contains filtered or unexported fields
}

### func NewGamePlayer

func NewGamePlayer(isHuman bool) *GamePlayer

NewGamePlayer コンストラクタ

### func (*GamePlayer) GetIsFinished

func (gp *GamePlayer) GetIsFinished() bool

GetIsFinished 上がっているかどうか

### func (*GamePlayer) GetIsHuman

func (gp *GamePlayer) GetIsHuman() bool

GetIsHuman 人間プレイヤーかどうか

### func (*GamePlayer) MarshalJSON

func (gp *GamePlayer) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*GamePlayer) SetIsFinished

func (gp *GamePlayer) SetIsFinished(v bool)

SetIsFinished 上がり状態設定

### func (*GamePlayer) UnmarshalJSON

func (gp *GamePlayer) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type GameResult

GameResult ゲーム勝敗結果

type GameResult int

GameResult定数

const (
    // GameResultWin 勝利
    GameResultWin GameResult = 1
    // GameResultDraw 引き分け
    GameResultDraw GameResult = 0
    // GameResultLose 敗北
    GameResultLose GameResult = -1
)

## type GinRummy

GinRummy ジンラミーゲームクラス

type GinRummy struct {
    // contains filtered or unexported fields
}

### func NewGinRummy

func NewGinRummy(trumpCards *TrumpCards, players []*GinRummyPlayer, config GinRummyConfig) *GinRummy

NewGinRummy コンストラクタ

### func (*GinRummy) CpuPlay

func (g *GinRummy) CpuPlay()

CpuPlay 現在の手番がCPUの場合にターンを実行

### func (*GinRummy) GetActionLog

func (g *GinRummy) GetActionLog() []*ActionLogEntry

GetActionLog 棋譜取得

### func (*GinRummy) GetConfig

func (g *GinRummy) GetConfig() GinRummyConfig

GetConfig 設定取得

### func (*GinRummy) GetCurrentPlayerIdx

func (g *GinRummy) GetCurrentPlayerIdx() int

GetCurrentPlayerIdx 現在のプレイヤーインデックス取得

### func (*GinRummy) GetDiscardPile

func (g *GinRummy) GetDiscardPile() []*Card

GetDiscardPile 捨て札の山を取得

### func (*GinRummy) GetDiscardTop

func (g *GinRummy) GetDiscardTop() *Card

GetDiscardTop 捨て札の一番上を取得

### func (*GinRummy) GetDrawPileCount

func (g *GinRummy) GetDrawPileCount() int

GetDrawPileCount 山札の残り枚数取得

### func (*GinRummy) GetGameEndFlag

func (g *GinRummy) GetGameEndFlag() bool

GetGameEndFlag ゲーム終了フラグ取得

### func (*GinRummy) GetIsGin

func (g *GinRummy) GetIsGin() bool

GetIsGin ジンかどうか取得

### func (*GinRummy) GetKnockerDeadwood

func (g *GinRummy) GetKnockerDeadwood() []*Card

GetKnockerDeadwood ノッカーのデッドウッド取得

### func (*GinRummy) GetKnockerIdx

func (g *GinRummy) GetKnockerIdx() int

GetKnockerIdx ノッカーのインデックス取得

### func (*GinRummy) GetKnockerMelds

func (g *GinRummy) GetKnockerMelds() [][]*Card

GetKnockerMelds ノッカーのメルド取得

### func (*GinRummy) GetPhase

func (g *GinRummy) GetPhase() GinRummyPhase

GetPhase 現在のフェーズ取得

### func (*GinRummy) GetPlayer

func (g *GinRummy) GetPlayer(i int) *GinRummyPlayer

GetPlayer プレイヤー取得

### func (*GinRummy) GetPlayerCnt

func (g *GinRummy) GetPlayerCnt() int

GetPlayerCnt プレイヤー数取得

### func (*GinRummy) GetRoundNumber

func (g *GinRummy) GetRoundNumber() int

GetRoundNumber 現在のラウンド番号取得

### func (*GinRummy) GetWinnerIdx

func (g *GinRummy) GetWinnerIdx() int

GetWinnerIdx 勝者インデックス取得 (-1 = 未確定)

### func (*GinRummy) IsHumanTurn

func (g *GinRummy) IsHumanTurn() bool

IsHumanTurn 現在の手番が人間かどうか

### func (*GinRummy) MarshalJSON

func (g *GinRummy) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*GinRummy) NextRound

func (g *GinRummy) NextRound()

NextRound 次のラウンドを開始する

### func (*GinRummy) PlayerDiscard

func (g *GinRummy) PlayerDiscard(cardIndex int) error

PlayerDiscard 人間プレイヤーがカードを捨てる

### func (*GinRummy) PlayerDrawFromDiscard

func (g *GinRummy) PlayerDrawFromDiscard() error

PlayerDrawFromDiscard 人間プレイヤーが捨て札からカードを引く

### func (*GinRummy) PlayerDrawFromStock

func (g *GinRummy) PlayerDrawFromStock() error

PlayerDrawFromStock 人間プレイヤーが山札からカードを引く

### func (*GinRummy) PlayerKnock

func (g *GinRummy) PlayerKnock(cardIndex int) error

PlayerKnock 人間プレイヤーがノックする (カードを1枚捨ててノック)

### func (*GinRummy) PlayerLayoff

func (g *GinRummy) PlayerLayoff(cardIndices []int) error

PlayerLayoff 人間プレイヤーがレイオフするカードを選択する (空のindicesでレイオフ終了)

### func (*GinRummy) Reset

func (g *GinRummy) Reset()

Reset ゲーム初期化

### func (*GinRummy) ScoreRound

func (g *GinRummy) ScoreRound()

ScoreRound ラウンドのスコア処理 (NextRoundから呼ぶ用。既にscoreRoundで処理済みの場合はnoop)

### func (*GinRummy) SetConfig

func (g *GinRummy) SetConfig(cfg GinRummyConfig)

SetConfig 設定変更

### func (*GinRummy) SetCurrentPlayerIdx

func (g *GinRummy) SetCurrentPlayerIdx(idx int)

SetCurrentPlayerIdx プレイヤーインデックス設定 (テスト用)

### func (*GinRummy) SetDiscardPile

func (g *GinRummy) SetDiscardPile(pile []*Card)

SetDiscardPile 捨て札の山を設定 (テスト用)

### func (*GinRummy) SetDrawPile

func (g *GinRummy) SetDrawPile(pile []*Card)

SetDrawPile 山札を設定 (テスト用)

### func (*GinRummy) SetIsGin

func (g *GinRummy) SetIsGin(isGin bool)

SetIsGin ジンを設定 (テスト用)

### func (*GinRummy) SetKnockerDeadwood

func (g *GinRummy) SetKnockerDeadwood(deadwood []*Card)

SetKnockerDeadwood ノッカーのデッドウッドを設定 (テスト用)

### func (*GinRummy) SetKnockerIdx

func (g *GinRummy) SetKnockerIdx(idx int)

SetKnockerIdx ノッカーのインデックス設定 (テスト用)

### func (*GinRummy) SetKnockerMelds

func (g *GinRummy) SetKnockerMelds(melds [][]*Card)

SetKnockerMelds ノッカーのメルドを設定 (テスト用)

### func (*GinRummy) SetPhase

func (g *GinRummy) SetPhase(phase GinRummyPhase)

SetPhase フェーズ設定 (テスト用)

### func (*GinRummy) SetRoundNumber

func (g *GinRummy) SetRoundNumber(n int)

SetRoundNumber ラウンド番号設定 (テスト用)

### func (*GinRummy) UnmarshalJSON

func (g *GinRummy) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type GinRummyConfig

GinRummyConfig ジンラミーゲーム設定

type GinRummyConfig struct {
    CpuDifficulty GinRummyCpuDifficulty `json:"cd"`
    PointLimit    int                   `json:"pl"` // ゲーム終了スコア (先に到達したプレイヤーが勝利)
}

### func DefaultGinRummyConfig

func DefaultGinRummyConfig() GinRummyConfig

DefaultGinRummyConfig デフォルト設定を返す

### func (GinRummyConfig) Validate

func (c GinRummyConfig) Validate() error

Validate 設定値のドメインバリデーション

## type GinRummyCpuDifficulty

GinRummyCpuDifficulty CPU の難易度レベル

type GinRummyCpuDifficulty int

GinRummyのCPU難易度定数

const (
    // GinRummyCpuDifficultyEasy 低難易度
    GinRummyCpuDifficultyEasy GinRummyCpuDifficulty = iota
    // GinRummyCpuDifficultyNormal 中難易度
    GinRummyCpuDifficultyNormal
    // GinRummyCpuDifficultyHard 高難易度
    GinRummyCpuDifficultyHard
)

## type GinRummyPhase

GinRummyPhase ゲームフェーズ

type GinRummyPhase int

GinRummyのフェーズ定数

const (
    // GinRummyPhaseDraw ドローフェーズ (山札または捨て札から引く)
    GinRummyPhaseDraw GinRummyPhase = 0
    // GinRummyPhaseDiscard ディスカードフェーズ (手札から1枚捨てる or ノック/ジン)
    GinRummyPhaseDiscard GinRummyPhase = 1
    // GinRummyPhaseLayoff レイオフフェーズ (相手がノッカーのメルドにカードを付ける)
    GinRummyPhaseLayoff GinRummyPhase = 2
    // GinRummyPhaseRoundEnd ラウンド終了フェーズ
    GinRummyPhaseRoundEnd GinRummyPhase = 3
    // GinRummyPhaseGameEnd ゲーム終了フェーズ
    GinRummyPhaseGameEnd GinRummyPhase = 4
)

## type GinRummyPlayer

GinRummyPlayer ジンラミープレイヤークラス

type GinRummyPlayer struct {
    *GamePlayer
    RoundScoreHolder
}

### func NewGinRummyPlayer

func NewGinRummyPlayer(isHuman bool) *GinRummyPlayer

NewGinRummyPlayer コンストラクタ

### func (*GinRummyPlayer) MarshalJSON

func (p *GinRummyPlayer) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*GinRummyPlayer) ResetRound

func (p *GinRummyPlayer) ResetRound()

ResetRound ラウンドをリセット(手札・スコア・終了状態を初期化)

### func (*GinRummyPlayer) UnmarshalJSON

func (p *GinRummyPlayer) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type GoFish

GoFish Go Fishゲームクラス

type GoFish struct {
    // contains filtered or unexported fields
}

### func NewGoFish

func NewGoFish(trumpCards *TrumpCards, players []*GoFishPlayer) *GoFish

NewGoFish コンストラクタ

### func (*GoFish) CpuAsk

func (g *GoFish) CpuAsk() error

CpuAsk CPUプレイヤーが1回要求を実行する

### func (*GoFish) GetActionLog

func (g *GoFish) GetActionLog() []*ActionLogEntry

GetActionLog 棋譜を取得する

### func (*GoFish) GetConfig

func (g *GoFish) GetConfig() GoFishConfig

GetConfig ゲーム設定を取得する

### func (*GoFish) GetCpuActions

func (g *GoFish) GetCpuActions() []*GoFishCpuAction

GetCpuActions CPUターンの行動履歴を取得する

### func (*GoFish) GetCurrentTurn

func (g *GoFish) GetCurrentTurn() int

GetCurrentTurn 現在の手番プレイヤーインデックスを取得する

### func (*GoFish) GetDeckRemaining

func (g *GoFish) GetDeckRemaining() int

GetDeckRemaining 山札の残り枚数を取得する

### func (*GoFish) GetGameEndFlag

func (g *GoFish) GetGameEndFlag() bool

GetGameEndFlag ゲーム終了フラグを取得する

### func (*GoFish) GetHumanAction

func (g *GoFish) GetHumanAction() *GoFishCpuAction

GetHumanAction 人間の最後の行動記録を取得する

### func (*GoFish) GetLastAskPlayerIdx

func (g *GoFish) GetLastAskPlayerIdx() int

GetLastAskPlayerIdx 最後に要求したプレイヤーのインデックスを取得する

### func (*GoFish) GetLastAskRank

func (g *GoFish) GetLastAskRank() int

GetLastAskRank 最後に要求されたランクを取得する

### func (*GoFish) GetLastAskSuccess

func (g *GoFish) GetLastAskSuccess() bool

GetLastAskSuccess 最後の要求が成功したかを返す

### func (*GoFish) GetLastAskTargetIdx

func (g *GoFish) GetLastAskTargetIdx() int

GetLastAskTargetIdx 最後に要求された相手のインデックスを取得する

### func (*GoFish) GetLastBookFormed

func (g *GoFish) GetLastBookFormed() bool

GetLastBookFormed 最後のアクションでブックが完成したかを返す

### func (*GoFish) GetLastBookRank

func (g *GoFish) GetLastBookRank() int

GetLastBookRank 最後に完成したブックのランクを取得する

### func (*GoFish) GetLastCardsReceived

func (g *GoFish) GetLastCardsReceived() []*Card

GetLastCardsReceived 最後に受け取ったカードを取得する

### func (*GoFish) GetLastDrawnCard

func (g *GoFish) GetLastDrawnCard() *Card

GetLastDrawnCard 最後にGo Fishで引いたカードを取得する

### func (*GoFish) GetPhase

func (g *GoFish) GetPhase() GoFishPhase

GetPhase ゲームフェーズを取得する

### func (*GoFish) GetPlayer

func (g *GoFish) GetPlayer(i int) *GoFishPlayer

GetPlayer 指定インデックスのプレイヤーを取得する

### func (*GoFish) GetPlayerCnt

func (g *GoFish) GetPlayerCnt() int

GetPlayerCnt プレイヤー数を取得する

### func (*GoFish) GetTurnNumber

func (g *GoFish) GetTurnNumber() int

GetTurnNumber 現在のターン番号を取得する

### func (*GoFish) GetWinnerIdx

func (g *GoFish) GetWinnerIdx() int

GetWinnerIdx 勝者プレイヤーインデックスを取得する

### func (*GoFish) IsHumanTurn

func (g *GoFish) IsHumanTurn() bool

IsHumanTurn 現在の手番が人間かを返す

### func (*GoFish) MarshalJSON

func (g *GoFish) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*GoFish) PlayerAsk

func (g *GoFish) PlayerAsk(targetIdx, rank int) error

PlayerAsk 人間プレイヤーが相手にランクを要求する

### func (*GoFish) Reset

func (g *GoFish) Reset()

Reset ゲームを初期化する

### func (*GoFish) SetConfig

func (g *GoFish) SetConfig(config GoFishConfig)

SetConfig ゲーム設定をセットする

### func (*GoFish) UnmarshalJSON

func (g *GoFish) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type GoFishConfig

GoFishConfig Go Fishゲーム設定

type GoFishConfig struct {
    CpuDifficulty GoFishCpuDifficulty
}

### func DefaultGoFishConfig

func DefaultGoFishConfig() GoFishConfig

DefaultGoFishConfig デフォルト設定を返す

### func (GoFishConfig) MarshalJSON

func (c GoFishConfig) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*GoFishConfig) UnmarshalJSON

func (c *GoFishConfig) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

### func (GoFishConfig) Validate

func (c GoFishConfig) Validate() error

Validate 設定値のドメインバリデーション

## type GoFishCpuAction

GoFishCpuAction CPUの1回の要求記録

type GoFishCpuAction struct {
    AskPlayerIdx  int   // 要求したプレイヤーインデックス
    AskTargetIdx  int   // 要求された相手のインデックス
    AskRank       int   // 要求したランク
    Success       bool  // 相手がカードを持っていたか
    CardsReceived int   // 受け取ったカード枚数
    DrawnCard     *Card // Go Fishで引いたカード (nil=要求成功)
    BookFormed    bool  // ブックが完成したか
    BookRank      int   // 完成したブックのランク (BookFormed=falseなら0)
}

## type GoFishCpuDifficulty

GoFishCpuDifficulty CPU の難易度レベル

type GoFishCpuDifficulty int

GoFishのCPU難易度定数

const (
    // GoFishCpuDifficultyEasy 低難易度: ランダムに要求
    GoFishCpuDifficultyEasy GoFishCpuDifficulty = iota
    // GoFishCpuDifficultyNormal 中難易度: 手札のランクのみ要求、直近の記憶に依存
    GoFishCpuDifficultyNormal
    // GoFishCpuDifficultyHard 高難易度: 全要求履歴から最適な相手とランクを推測
    GoFishCpuDifficultyHard
)

## type GoFishPhase

GoFishPhase ゲームフェーズ

type GoFishPhase int

GoFishのフェーズ定数

const (
    GoFishPhasePlay    GoFishPhase = iota // プレイ中
    GoFishPhaseGameEnd                    // ゲーム終了
)

## type GoFishPlayer

GoFishPlayer Go Fishプレイヤークラス

type GoFishPlayer struct {
    *GamePlayer
    // contains filtered or unexported fields
}

### func NewGoFishPlayer

func NewGoFishPlayer(isHuman bool) *GoFishPlayer

NewGoFishPlayer コンストラクタ

### func (*GoFishPlayer) AddBook

func (p *GoFishPlayer) AddBook(cards []*Card)

AddBook ブックを追加する

### func (*GoFishPlayer) CountRank

func (p *GoFishPlayer) CountRank(rank int) int

CountRank 指定ランクのカード枚数を返す

### func (*GoFishPlayer) GetBookCount

func (p *GoFishPlayer) GetBookCount() int

GetBookCount 完成したブック数を取得する

### func (*GoFishPlayer) GetBooks

func (p *GoFishPlayer) GetBooks() [][]*Card

GetBooks 完成したブック一覧を取得する

### func (*GoFishPlayer) GetDistinctRanks

func (p *GoFishPlayer) GetDistinctRanks() []int

GetDistinctRanks 手札に含まれるユニークなランク一覧を返す

### func (*GoFishPlayer) HasRank

func (p *GoFishPlayer) HasRank(rank int) bool

HasRank 指定ランクのカードを手札に持っているかを返す

### func (*GoFishPlayer) MarshalJSON

func (p *GoFishPlayer) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*GoFishPlayer) RemoveAllOfRank

func (p *GoFishPlayer) RemoveAllOfRank(rank int) []*Card

RemoveAllOfRank 指定ランクのカードを全て手札から取り除いて返す

### func (*GoFishPlayer) ResetBooks

func (p *GoFishPlayer) ResetBooks()

ResetBooks ブックをリセットする

### func (*GoFishPlayer) UnmarshalJSON

func (p *GoFishPlayer) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type Golf

Golf ゴルフソリティアゲームクラス

type Golf struct {
    // contains filtered or unexported fields
}

### func NewGolf

func NewGolf(trumpCards *TrumpCards) *Golf

NewGolf コンストラクタ

### func (*Golf) AllRemoved

func (g *Golf) AllRemoved() bool

AllRemoved 全タブローカードが除去されたか

### func (*Golf) CanUndo

func (g *Golf) CanUndo() bool

CanUndo アンドゥ可能かどうか

### func (*Golf) Draw

func (g *Golf) Draw() error

Draw ストックからウェイストにカードを引く

### func (*Golf) GetActionLog

func (g *Golf) GetActionLog() []*ActionLogEntry

GetActionLog 棋譜取得

### func (*Golf) GetHint

func (g *Golf) GetHint() *GolfHint

GetHint ヒントを取得

### func (*Golf) GetLayout

func (g *Golf) GetLayout() [GolfColCnt][GolfRowCnt]*GolfCard

GetLayout レイアウト取得

### func (*Golf) GetMoveCount

func (g *Golf) GetMoveCount() int

GetMoveCount 移動回数取得

### func (*Golf) GetPhase

func (g *Golf) GetPhase() GolfPhase

GetPhase フェーズ取得

### func (*Golf) GetStockCount

func (g *Golf) GetStockCount() int

GetStockCount ストック枚数取得

### func (*Golf) GetWaste

func (g *Golf) GetWaste() []*Card

GetWaste ウェイスト取得

### func (*Golf) GiveUp

func (g *Golf) GiveUp()

GiveUp ギブアップ

### func (*Golf) IsExposed

func (g *Golf) IsExposed(col, row int) bool

IsExposed カードが露出しているか (テスト用の公開版)

### func (*Golf) IsStalemate

func (g *Golf) IsStalemate() bool

IsStalemate 手詰まり状態取得

### func (*Golf) MarshalJSON

func (g *Golf) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*Golf) Remove

func (g *Golf) Remove(col int) error

Remove タブローのカードを除去

### func (*Golf) Reset

func (g *Golf) Reset()

Reset ゲームリセット

### func (*Golf) SetIsStalemate

func (g *Golf) SetIsStalemate(v bool)

SetIsStalemate 手詰まり状態設定 (テスト用)

### func (*Golf) SetLayout

func (g *Golf) SetLayout(layout [GolfColCnt][GolfRowCnt]*GolfCard)

SetLayout レイアウト設定 (テスト用)

### func (*Golf) SetPhase

func (g *Golf) SetPhase(phase GolfPhase)

SetPhase フェーズ設定 (テスト用)

### func (*Golf) SetStock

func (g *Golf) SetStock(stock []*Card)

SetStock ストック設定 (テスト用)

### func (*Golf) SetWaste

func (g *Golf) SetWaste(waste []*Card)

SetWaste ウェイスト設定 (テスト用)

### func (*Golf) Undo

func (g *Golf) Undo() error

Undo 直前の操作を取り消す

### func (*Golf) UndoN

func (g *Golf) UndoN(n int) error

UndoN n回連続でアンドゥを実行する。

### func (*Golf) UndoToEscape

func (g *Golf) UndoToEscape() int

UndoToEscape 膠着状態から抜けるために必要なアンドゥ回数を返す。膠着状態でなければ0、脱出不可なら-1。

### func (*Golf) UnmarshalJSON

func (g *Golf) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type GolfCard

GolfCard タブロー上のカード

type GolfCard struct {
    Card    *Card `json:"c"`
    Removed bool  `json:"r"`
}

## type GolfHint

GolfHint ヒント

type GolfHint struct {
    Type string // "remove" or "draw"
    Col  int
}

## type GolfPhase

GolfPhase ゴルフソリティアゲームフェーズ

type GolfPhase int

Golfのフェーズ定数

const (
    // GolfPhasePlaying プレイ中
    GolfPhasePlaying GolfPhase = iota
    // GolfPhaseGameClear ゲームクリア
    GolfPhaseGameClear
    // GolfPhaseGameOver ゲームオーバー
    GolfPhaseGameOver
)

## type Hearts

Hearts ハーツゲームクラス

type Hearts struct {
    // contains filtered or unexported fields
}

### func NewHearts

func NewHearts(trumpCards *TrumpCards, players []*HeartsPlayer, config HeartsConfig) *Hearts

NewHearts コンストラクタ

### func (*Hearts) CpuPass

func (h *Hearts) CpuPass()

CpuPass すべてのCPUプレイヤーがカードを選択する

### func (*Hearts) CpuPlay

func (h *Hearts) CpuPlay()

CpuPlay 現在の手番がCPUの場合に1ターン実行

### func (*Hearts) ExecutePass

func (h *Hearts) ExecutePass()

ExecutePass カード交換を実行する

### func (*Hearts) GetActionLog

func (h *Hearts) GetActionLog() []*ActionLogEntry

GetActionLog 棋譜取得

### func (*Hearts) GetConfig

func (h *Hearts) GetConfig() HeartsConfig

GetConfig 設定取得

### func (*Hearts) GetCurrentPlayerIdx

func (h *Hearts) GetCurrentPlayerIdx() int

GetCurrentPlayerIdx 現在のプレイヤーインデックス取得

### func (*Hearts) GetCurrentTrick

func (h *Hearts) GetCurrentTrick() []*HeartsTrickCard

GetCurrentTrick 現在のトリック取得

### func (*Hearts) GetGameEndFlag

func (h *Hearts) GetGameEndFlag() bool

GetGameEndFlag ゲーム終了フラグ取得

### func (*Hearts) GetHeartsBroken

func (h *Hearts) GetHeartsBroken() bool

GetHeartsBroken ハーツブレイク状態取得

### func (*Hearts) GetHint

func (h *Hearts) GetHint() *HeartsHint

GetHint ヒントを取得する

### func (*Hearts) GetLeadPlayerIdx

func (h *Hearts) GetLeadPlayerIdx() int

GetLeadPlayerIdx リードプレイヤーインデックス取得

### func (*Hearts) GetPassDirection

func (h *Hearts) GetPassDirection() HeartsPassDirection

GetPassDirection 現在のラウンドの交換方向取得

### func (*Hearts) GetPassReady

func (h *Hearts) GetPassReady() [HeartsPlayerCnt]bool

GetPassReady パス準備状態取得

### func (*Hearts) GetPassedCards

func (h *Hearts) GetPassedCards() [HeartsPlayerCnt][]*Card

GetPassedCards パス済みカード取得

### func (*Hearts) GetPhase

func (h *Hearts) GetPhase() HeartsPhase

GetPhase 現在のフェーズ取得

### func (*Hearts) GetPlayer

func (h *Hearts) GetPlayer(i int) *HeartsPlayer

GetPlayer プレイヤー取得

### func (*Hearts) GetPlayerCnt

func (h *Hearts) GetPlayerCnt() int

GetPlayerCnt プレイヤー数取得

### func (*Hearts) GetRoundNumber

func (h *Hearts) GetRoundNumber() int

GetRoundNumber 現在のラウンド番号取得

### func (*Hearts) GetTrickNumber

func (h *Hearts) GetTrickNumber() int

GetTrickNumber 現在のトリック番号取得

### func (*Hearts) GetWinnerIdx

func (h *Hearts) GetWinnerIdx() int

GetWinnerIdx 勝者インデックス取得 (-1 = 未確定)

### func (*Hearts) IsHumanTurn

func (h *Hearts) IsHumanTurn() bool

IsHumanTurn 現在の手番が人間かどうか

### func (*Hearts) MarshalJSON

func (h *Hearts) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*Hearts) NextRound

func (h *Hearts) NextRound()

NextRound 次のラウンドを開始する

### func (*Hearts) NextTrick

func (h *Hearts) NextTrick()

NextTrick 次のトリックを開始する

### func (*Hearts) PlayerPass

func (h *Hearts) PlayerPass(cardIndices []int) error

PlayerPass 人間プレイヤーがカードを渡す

### func (*Hearts) PlayerPlay

func (h *Hearts) PlayerPlay(cardIndex int) error

PlayerPlay 人間プレイヤーがカードをプレイする

### func (*Hearts) Reset

func (h *Hearts) Reset()

Reset ゲーム初期化: デッキをシャッフルして配布し、最初のフェーズを設定

### func (*Hearts) ResolveTrick

func (h *Hearts) ResolveTrick()

ResolveTrick トリックを解決して勝者を決定する

### func (*Hearts) ScoreRound

func (h *Hearts) ScoreRound()

ScoreRound ラウンドのスコアを確定し、ゲーム終了判定を行う

### func (*Hearts) SetConfig

func (h *Hearts) SetConfig(cfg HeartsConfig)

SetConfig 設定変更

### func (*Hearts) SetCurrentPlayerIdx

func (h *Hearts) SetCurrentPlayerIdx(idx int)

SetCurrentPlayerIdx プレイヤーインデックス設定 (テスト用)

### func (*Hearts) SetCurrentTrick

func (h *Hearts) SetCurrentTrick(trick []*HeartsTrickCard)

SetCurrentTrick トリック設定 (テスト用)

### func (*Hearts) SetHeartsBroken

func (h *Hearts) SetHeartsBroken(broken bool)

SetHeartsBroken ハーツブレイク状態設定 (テスト用)

### func (*Hearts) SetLeadPlayerIdx

func (h *Hearts) SetLeadPlayerIdx(idx int)

SetLeadPlayerIdx リードプレイヤーインデックス設定 (テスト用)

### func (*Hearts) SetPhase

func (h *Hearts) SetPhase(phase HeartsPhase)

SetPhase フェーズ設定 (テスト用)

### func (*Hearts) SetRoundNumber

func (h *Hearts) SetRoundNumber(n int)

SetRoundNumber ラウンド番号設定 (テスト用)

### func (*Hearts) SetTrickNumber

func (h *Hearts) SetTrickNumber(n int)

SetTrickNumber トリック番号設定 (テスト用)

### func (*Hearts) UnmarshalJSON

func (h *Hearts) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type HeartsConfig

HeartsConfig ハーツゲーム設定

type HeartsConfig struct {
    CpuDifficulty HeartsCpuDifficulty `json:"cd"`
    PointLimit    int                 `json:"pl"` // ゲーム終了スコア (いずれかのプレイヤーがこの点数に達したら終了)
    OmnibusJD     bool                `json:"oj"` // オムニバス・ハーツ: J♦獲得で-10点
}

### func DefaultHeartsConfig

func DefaultHeartsConfig() HeartsConfig

DefaultHeartsConfig デフォルト設定を返す

### func (HeartsConfig) Validate

func (c HeartsConfig) Validate() error

Validate 設定値のドメインバリデーション

## type HeartsCpuDifficulty

HeartsCpuDifficulty CPU の難易度レベル

type HeartsCpuDifficulty int

HeartsのCPU難易度定数

const (
    // HeartsCpuDifficultyEasy 低難易度
    HeartsCpuDifficultyEasy HeartsCpuDifficulty = iota
    // HeartsCpuDifficultyNormal 中難易度
    HeartsCpuDifficultyNormal
    // HeartsCpuDifficultyHard 高難易度
    HeartsCpuDifficultyHard
)

## type HeartsHint

HeartsHint ヒント情報

type HeartsHint struct {
    CardIndices []int  // 推奨カードインデックス (プレイ時1枚, パス時3枚)
    Reason      string // ヒント理由キー
}

## type HeartsPassDirection

HeartsPassDirection カード交換方向

type HeartsPassDirection int

Heartsのカードパス方向定数

const (
    // HeartsPassLeft 左へ渡す
    HeartsPassLeft HeartsPassDirection = 0
    // HeartsPassRight 右へ渡す
    HeartsPassRight HeartsPassDirection = 1
    // HeartsPassAcross 向かいへ渡す
    HeartsPassAcross HeartsPassDirection = 2
    // HeartsPassNone 交換なし
    HeartsPassNone HeartsPassDirection = 3
)

## type HeartsPhase

HeartsPhase ゲームフェーズ

type HeartsPhase int

Heartsのフェーズ定数

const (
    // HeartsPhasePass カード交換フェーズ
    HeartsPhasePass HeartsPhase = 0
    // HeartsPhasePlay トリックプレイフェーズ
    HeartsPhasePlay HeartsPhase = 1
    // HeartsPhaseTrickEnd トリック終了フェーズ
    HeartsPhaseTrickEnd HeartsPhase = 2
    // HeartsPhaseRoundEnd ラウンド終了フェーズ
    HeartsPhaseRoundEnd HeartsPhase = 3
    // HeartsPhaseGameEnd ゲーム終了フェーズ
    HeartsPhaseGameEnd HeartsPhase = 4
)

## type HeartsPlayer

HeartsPlayer ハーツプレイヤークラス

type HeartsPlayer struct {
    *GamePlayer
    RoundScoreHolder
    TrickHolder
}

### func NewHeartsPlayer

func NewHeartsPlayer(isHuman bool) *HeartsPlayer

NewHeartsPlayer コンストラクタ

### func (*HeartsPlayer) MarshalJSON

func (p *HeartsPlayer) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*HeartsPlayer) ResetRound

func (p *HeartsPlayer) ResetRound()

ResetRound ラウンドをリセット(スコア・トリック・手札・終了状態を初期化)

### func (*HeartsPlayer) UnmarshalJSON

func (p *HeartsPlayer) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type HeartsTrickCard

HeartsTrickCard トリック中の1枚

type HeartsTrickCard struct {
    PlayerIdx int   `json:"pi"`
    Card      *Card `json:"c"`
}

## type Holdem

Holdem テキサスホールデムクラス

type Holdem struct {
    // contains filtered or unexported fields
}

### func NewHoldem

func NewHoldem(trumpCards *TrumpCards, players []*HoldemPlayer, config HoldemConfig) *Holdem

NewHoldem コンストラクタ

### func (*Holdem) Addon

func (h *Holdem) Addon() error

Addon 人間プレイヤーがアドオンを実行する

### func (*Holdem) ExportProfile

func (h *Holdem) ExportProfile() interface{}

ExportProfile メタAIプロファイルをエクスポートする (プロファイルがない場合はnil)

### func (*Holdem) GetActedFlags

func (h *Holdem) GetActedFlags() []bool

GetActedFlags actedフラグ取得

### func (*Holdem) GetActionLog

func (h *Holdem) GetActionLog() []*ActionLogEntry

GetActionLog 棋譜を取得する

### func (*Holdem) GetAddonUsed

func (h *Holdem) GetAddonUsed() []bool

GetAddonUsed プレイヤーごとのアドオン使用フラグ取得

### func (*Holdem) GetCommunityCards

func (h *Holdem) GetCommunityCards() []*Card

GetCommunityCards コミュニティカード取得

### func (*Holdem) GetConfig

func (h *Holdem) GetConfig() HoldemConfig

GetConfig 設定取得

### func (*Holdem) GetCpuActions

func (h *Holdem) GetCpuActions() []HoldemCpuAction

GetCpuActions CPU行動記録取得

### func (*Holdem) GetCurrentTurn

func (h *Holdem) GetCurrentTurn() int

GetCurrentTurn 現在のターン取得

### func (*Holdem) GetDealerIdx

func (h *Holdem) GetDealerIdx() int

GetDealerIdx ディーラーインデックス取得

### func (*Holdem) GetEquity

func (h *Holdem) GetEquity() *HoldemEquityResult

GetEquity エクイティ計算結果を返す (PreFlop-Riverフェーズで人間がフォールドしていない場合のみ)

### func (*Holdem) GetGameEndFlag

func (h *Holdem) GetGameEndFlag() bool

GetGameEndFlag ゲーム終了フラグ取得

### func (*Holdem) GetHandCount

func (h *Holdem) GetHandCount() int

GetHandCount ハンド数取得

### func (*Holdem) GetHumanProfile

func (h *Holdem) GetHumanProfile() *BettingHumanProfile

GetHumanProfile メタAIプロファイル取得

### func (*Holdem) GetLastBet

func (h *Holdem) GetLastBet() int

GetLastBet 最後のベット取得

### func (*Holdem) GetLastCpuError

func (h *Holdem) GetLastCpuError() error

GetLastCpuError 最後のCPUアクションエラー取得 (テスト・デバッグ用)

### func (*Holdem) GetMinRaise

func (h *Holdem) GetMinRaise() int

GetMinRaise 最小レイズ額取得

### func (*Holdem) GetPhase

func (h *Holdem) GetPhase() int

GetPhase フェーズ取得

### func (*Holdem) GetPlayer

func (h *Holdem) GetPlayer(i int) *HoldemPlayer

GetPlayer 指定プレイヤー取得

### func (*Holdem) GetPlayerCnt

func (h *Holdem) GetPlayerCnt() int

GetPlayerCnt プレイヤー数取得

### func (*Holdem) GetPlayers

func (h *Holdem) GetPlayers() []*HoldemPlayer

GetPlayers プレイヤー一覧取得

### func (*Holdem) GetPot

func (h *Holdem) GetPot() int

GetPot ポット取得

### func (*Holdem) GetPotOdds

func (h *Holdem) GetPotOdds() float64

GetPotOdds ポットオッズを返す (PreFlop-Riverフェーズのみ)

### func (*Holdem) GetRaiseCount

func (h *Holdem) GetRaiseCount() int

GetRaiseCount 現在のレイズ回数取得

### func (*Holdem) GetRebuyCounts

func (h *Holdem) GetRebuyCounts() []int

GetRebuyCounts プレイヤーごとのリバイ回数取得

### func (*Holdem) GetRebuyPhaseType

func (h *Holdem) GetRebuyPhaseType() int

GetRebuyPhaseType リバイフェーズ種別取得

### func (*Holdem) GetRoundResults

func (h *Holdem) GetRoundResults() []HoldemResult

GetRoundResults ラウンド結果取得

### func (*Holdem) GetSidePots

func (h *Holdem) GetSidePots() []HoldemSidePot

GetSidePots サイドポット取得

### func (*Holdem) ImportProfile

func (h *Holdem) ImportProfile(data []byte) error

ImportProfile JSONバイトからメタAIプロファイルをインポートする

### func (*Holdem) IsAddonAvailable

func (h *Holdem) IsAddonAvailable() bool

IsAddonAvailable 人間プレイヤーがアドオン可能かどうか

### func (*Holdem) IsHumanTurn

func (h *Holdem) IsHumanTurn() bool

IsHumanTurn 人間のターンかチェック

### func (*Holdem) IsMuckAvailable

func (h *Holdem) IsMuckAvailable() bool

IsMuckAvailable 人間プレイヤーがマック可能かどうか

### func (*Holdem) IsRebuyAvailable

func (h *Holdem) IsRebuyAvailable() bool

IsRebuyAvailable 人間プレイヤーがリバイ可能かどうか

### func (*Holdem) MarshalJSON

func (h *Holdem) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*Holdem) Muck

func (h *Holdem) Muck() error

Muck 人間プレイヤーがハンドをマックする (公開せずに伏せる)

### func (*Holdem) PlayerAction

func (h *Holdem) PlayerAction(action, amount, humanPlayMs int) error

PlayerAction 人間プレイヤーのアクション実行 humanPlayMs: 迷い時間(ms, 0=計測なし)

### func (*Holdem) Rebuy

func (h *Holdem) Rebuy() error

Rebuy 人間プレイヤーがリバイを実行する

### func (*Holdem) Reset

func (h *Holdem) Reset() error

Reset ゲーム初期化

### func (*Holdem) ResetProfile

func (h *Holdem) ResetProfile()

ResetProfile メタAIプロファイルをリセットする

### func (*Holdem) Resize

func (h *Holdem) Resize(players []*HoldemPlayer)

Resize プレイヤースライスを差し替え、プレイヤー数依存スライスを再初期化する

### func (*Holdem) SetConfig

func (h *Holdem) SetConfig(cfg HoldemConfig)

SetConfig 設定変更

### func (*Holdem) ShowHand

func (h *Holdem) ShowHand() error

ShowHand 人間プレイヤーがハンドを公開する

### func (*Holdem) SkipAddon

func (h *Holdem) SkipAddon() error

SkipAddon 人間プレイヤーがアドオンを辞退する

### func (*Holdem) SkipRebuy

func (h *Holdem) SkipRebuy() error

SkipRebuy 人間プレイヤーがリバイを辞退する

### func (*Holdem) UnmarshalJSON

func (h *Holdem) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type HoldemConfig

HoldemConfig テキサスホールデム設定

type HoldemConfig struct {
    SmallBlind       int              // スモールブラインド
    BigBlind         int              // ビッグブラインド
    InitChips        int              // 初期チップ
    TournamentMode   bool             // トーナメントモード
    BlindLevelHands  int              // ブラインドレベルアップまでのハンド数
    BlindMultiplier  int              // ブラインド倍率 (百分率: 200=2倍)
    BettingLimit     BettingLimitType // ベッティングリミット
    TableSize        int              // テーブルサイズ (4/6/9)
    RebuyEnabled     bool             // リバイ有効
    RebuyMaxCount    int              // リバイ最大回数
    RebuyChips       int              // リバイ時の補充チップ
    RebuyPeriodHands int              // リバイ可能期間 (ハンド数)
    AddonEnabled     bool             // アドオン有効
    AddonChips       int              // アドオン時の補充チップ
    AddonAfterHand   int              // アドオン提供ハンド番号
    CpuMetaAI        bool             // メタAI: セッション内学習
}

### func DefaultHoldemConfig

func DefaultHoldemConfig() HoldemConfig

DefaultHoldemConfig デフォルト設定

### func (HoldemConfig) Validate

func (c HoldemConfig) Validate() error

Validate 設定値のドメインバリデーション

## type HoldemCpuAction

HoldemCpuAction CPU行動記録

type HoldemCpuAction struct {
    PlayerIdx int // プレイヤーインデックス
    Action    int // アクション
    Amount    int // 金額
}

## type HoldemEquityResult

HoldemEquityResult エクイティ計算結果

type HoldemEquityResult struct {
    Equity   float64          // 勝率 (0.0 - 1.0)
    HandOdds []HoldemHandOdds // 各ハンドランクの確率
}

### func CalcEquity

func CalcEquity(humanCards, communityCards []*Card, activePlayers, simulations int, rng *rand.Rand) HoldemEquityResult

CalcEquity モンテカルロシミュレーションによるエクイティ計算 humanCards: 人間の手札, communityCards: コミュニティカード, activePlayers: アクティブ相手プレイヤー数, simulations: シミュレーション回数, rng: 乱数生成器 (nilの場合はグローバルrand使用)

### func CalcOmahaEquity

func CalcOmahaEquity(humanCards, communityCards []*Card, activePlayers, simulations int, rng *rand.Rand) HoldemEquityResult

CalcOmahaEquity モンテカルロシミュレーションによるオマハエクイティ計算 humanCards: 人間の手札(4枚), communityCards: コミュニティカード, activePlayers: アクティブ相手プレイヤー数, simulations: シミュレーション回数, rng: 乱数生成器 (nilの場合はグローバルrand使用)

### func CalcShortDeckEquity

func CalcShortDeckEquity(humanCards, communityCards []*Card, activePlayers, simulations int, rng *rand.Rand) HoldemEquityResult

CalcShortDeckEquity モンテカルロシミュレーションによるショートデックエクイティ計算 humanCards: 人間の手札(2枚), communityCards: コミュニティカード, activePlayers: アクティブ相手プレイヤー数, simulations: シミュレーション回数, rng: 乱数生成器 (nilの場合はグローバルrand使用)

## type HoldemHandOdds

HoldemHandOdds 各ハンドランクの確率

type HoldemHandOdds struct {
    HandRank    int     // ハンドランク
    HandName    string  // ハンド名
    Probability float64 // 確率 (0.0 - 1.0)
}

## type HoldemPlayStyle

HoldemPlayStyle CPUプレイスタイル

type HoldemPlayStyle int

Holdemのプレイスタイル定数

const (
    HoldemStyleTAG HoldemPlayStyle = iota // Tight-Aggressive
    HoldemStyleLAP                        // Loose-Passive
    HoldemStyleTAP                        // Tight-Passive
    HoldemStyleLAG                        // Loose-Aggressive
    HoldemStyleGTO                        // Game Theory Optimal
)

### func DefaultCpuStyles

func DefaultCpuStyles(tableSize int) []HoldemPlayStyle

DefaultCpuStyles テーブルサイズに応じたCPUスタイルを返す

## type HoldemPlayer

HoldemPlayer テキサスホールデムプレイヤークラス

type HoldemPlayer struct {
    Player     // 親クラス
    ChipHolder // チップ管理
    // contains filtered or unexported fields
}

### func NewHoldemPlayer

func NewHoldemPlayer(isHuman bool, style HoldemPlayStyle) *HoldemPlayer

NewHoldemPlayer コンストラクタ

### func NewPlayersForTable

func NewPlayersForTable(tableSize int) []*HoldemPlayer

NewPlayersForTable 指定されたテーブルサイズに応じたプレイヤースライスを生成する

### func (*HoldemPlayer) EvalBestHand

func (hp *HoldemPlayer) EvalBestHand(communityCards []*Card) int

EvalBestHand コミュニティカードとホールカードからベスト5枚を評価

### func (*HoldemPlayer) GetAFDisplay

func (hp *HoldemPlayer) GetAFDisplay() string

GetAFDisplay AF表示文字列取得 (“-”=アクションなし, “∞”=コールなし, “X.X”=通常)

### func (*HoldemPlayer) GetBestHand

func (hp *HoldemPlayer) GetBestHand() []*Card

GetBestHand ベストハンド取得

### func (*HoldemPlayer) GetComparisonCards

func (hp *HoldemPlayer) GetComparisonCards() []*Card

GetComparisonCards ハンド比較用カード取得 (BettingPlayerインターフェース)

### func (*HoldemPlayer) GetIsHuman

func (hp *HoldemPlayer) GetIsHuman() bool

GetIsHuman 人間フラグ取得

### func (*HoldemPlayer) GetPFR

func (hp *HoldemPlayer) GetPFR() int

GetPFR PFR%取得 (0 if totalHands==0)

### func (*HoldemPlayer) GetPFRCount

func (hp *HoldemPlayer) GetPFRCount() int

GetPFRCount PFR対象ハンド数取得

### func (*HoldemPlayer) GetPlayStyle

func (hp *HoldemPlayer) GetPlayStyle() HoldemPlayStyle

GetPlayStyle プレイスタイル取得

### func (*HoldemPlayer) GetPlayStyleName

func (hp *HoldemPlayer) GetPlayStyleName() string

GetPlayStyleName プレイスタイル名取得

### func (*HoldemPlayer) GetPostFlopBetRaise

func (hp *HoldemPlayer) GetPostFlopBetRaise() int

GetPostFlopBetRaise ポストフロップ ベット+レイズ回数取得

### func (*HoldemPlayer) GetPostFlopCall

func (hp *HoldemPlayer) GetPostFlopCall() int

GetPostFlopCall ポストフロップ コール回数取得

### func (*HoldemPlayer) GetThreeBet

func (hp *HoldemPlayer) GetThreeBet() int

GetThreeBet 3Bet%取得 (0 if threeBetOpportunity==0)

### func (*HoldemPlayer) GetThreeBetCount

func (hp *HoldemPlayer) GetThreeBetCount() int

GetThreeBetCount 3Bet実行数取得

### func (*HoldemPlayer) GetThreeBetOpportunity

func (hp *HoldemPlayer) GetThreeBetOpportunity() int

GetThreeBetOpportunity 3Bet機会数取得

### func (*HoldemPlayer) GetTotalHands

func (hp *HoldemPlayer) GetTotalHands() int

GetTotalHands 総ハンド数取得

### func (*HoldemPlayer) GetVPIP

func (hp *HoldemPlayer) GetVPIP() int

GetVPIP VPIP%取得 (0 if totalHands==0)

### func (*HoldemPlayer) GetVPIPCount

func (hp *HoldemPlayer) GetVPIPCount() int

GetVPIPCount VPIP対象ハンド数取得

### func (*HoldemPlayer) IncrementPFR

func (hp *HoldemPlayer) IncrementPFR()

IncrementPFR PFR対象ハンド数をインクリメント

### func (*HoldemPlayer) IncrementPostFlopBetRaise

func (hp *HoldemPlayer) IncrementPostFlopBetRaise()

IncrementPostFlopBetRaise ポストフロップ ベット+レイズ回数をインクリメント

### func (*HoldemPlayer) IncrementPostFlopCall

func (hp *HoldemPlayer) IncrementPostFlopCall()

IncrementPostFlopCall ポストフロップ コール回数をインクリメント

### func (*HoldemPlayer) IncrementThreeBet

func (hp *HoldemPlayer) IncrementThreeBet()

IncrementThreeBet 3Bet実行数をインクリメント

### func (*HoldemPlayer) IncrementThreeBetOpportunity

func (hp *HoldemPlayer) IncrementThreeBetOpportunity()

IncrementThreeBetOpportunity 3Bet機会数をインクリメント

### func (*HoldemPlayer) IncrementTotalHands

func (hp *HoldemPlayer) IncrementTotalHands()

IncrementTotalHands 総ハンド数をインクリメント

### func (*HoldemPlayer) IncrementVPIP

func (hp *HoldemPlayer) IncrementVPIP()

IncrementVPIP VPIP対象ハンド数をインクリメント

### func (*HoldemPlayer) MarshalJSON

func (hp *HoldemPlayer) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*HoldemPlayer) UnmarshalJSON

func (hp *HoldemPlayer) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type HoldemResult

HoldemResult ショーダウン結果

type HoldemResult struct {
    PlayerIdx int     // プレイヤーインデックス
    HandRank  int     // ハンドランク
    HandName  string  // ハンド名
    BestHand  []*Card // ベスト5枚
    Kickers   []int   // キッカーカード値
    WonAmount int     // 獲得チップ
    Mucked    bool    // マックしたかどうか
}

## type HoldemSidePot

HoldemSidePot サイドポット (共通SidePot型のエイリアス)

type HoldemSidePot = SidePot

## type IndianPoker

IndianPoker インディアンポーカークラス

type IndianPoker struct {
    // contains filtered or unexported fields
}

### func NewIndianPoker

func NewIndianPoker(trumpCards *TrumpCards, players []*IndianPokerPlayer, config IndianPokerConfig) *IndianPoker

NewIndianPoker コンストラクタ

### func (*IndianPoker) ExportProfile

func (ip *IndianPoker) ExportProfile() interface{}

ExportProfile メタAIプロファイルをエクスポートする (プロファイルがない場合はnil)

### func (*IndianPoker) GetActedFlags

func (ip *IndianPoker) GetActedFlags() []bool

GetActedFlags actedフラグ取得

### func (*IndianPoker) GetActionLog

func (ip *IndianPoker) GetActionLog() []*ActionLogEntry

GetActionLog 棋譜を取得する

### func (*IndianPoker) GetConfig

func (ip *IndianPoker) GetConfig() IndianPokerConfig

GetConfig 設定取得

### func (*IndianPoker) GetCpuActions

func (ip *IndianPoker) GetCpuActions() []IndianPokerCpuAction

GetCpuActions CPU行動記録取得

### func (*IndianPoker) GetCurrentTurn

func (ip *IndianPoker) GetCurrentTurn() int

GetCurrentTurn 現在のターン取得

### func (*IndianPoker) GetDealerIdx

func (ip *IndianPoker) GetDealerIdx() int

GetDealerIdx ディーラーインデックス取得

### func (*IndianPoker) GetGameEndFlag

func (ip *IndianPoker) GetGameEndFlag() bool

GetGameEndFlag ゲーム終了フラグ取得

### func (*IndianPoker) GetHandCount

func (ip *IndianPoker) GetHandCount() int

GetHandCount ハンド数取得

### func (*IndianPoker) GetHumanProfile

func (ip *IndianPoker) GetHumanProfile() *IndianPokerHumanProfile

GetHumanProfile メタAIプロファイル取得

### func (*IndianPoker) GetLastBet

func (ip *IndianPoker) GetLastBet() int

GetLastBet 最後のベット取得

### func (*IndianPoker) GetLastCpuError

func (ip *IndianPoker) GetLastCpuError() error

GetLastCpuError 最後のCPUアクションエラー取得 (テスト・デバッグ用)

### func (*IndianPoker) GetMinRaise

func (ip *IndianPoker) GetMinRaise() int

GetMinRaise 最小レイズ額取得

### func (*IndianPoker) GetPhase

func (ip *IndianPoker) GetPhase() int

GetPhase フェーズ取得

### func (*IndianPoker) GetPlayer

func (ip *IndianPoker) GetPlayer(i int) *IndianPokerPlayer

GetPlayer 指定プレイヤー取得

### func (*IndianPoker) GetPlayerCnt

func (ip *IndianPoker) GetPlayerCnt() int

GetPlayerCnt プレイヤー数取得

### func (*IndianPoker) GetPlayers

func (ip *IndianPoker) GetPlayers() []*IndianPokerPlayer

GetPlayers プレイヤー一覧取得

### func (*IndianPoker) GetPot

func (ip *IndianPoker) GetPot() int

GetPot ポット取得

### func (*IndianPoker) GetRaiseCount

func (ip *IndianPoker) GetRaiseCount() int

GetRaiseCount 現在のレイズ回数取得

### func (*IndianPoker) GetRoundResults

func (ip *IndianPoker) GetRoundResults() []IndianPokerResult

GetRoundResults ラウンド結果取得

### func (*IndianPoker) GetSidePots

func (ip *IndianPoker) GetSidePots() []IndianPokerSidePot

GetSidePots サイドポット取得

### func (*IndianPoker) ImportProfile

func (ip *IndianPoker) ImportProfile(data []byte) error

ImportProfile JSONバイトからメタAIプロファイルをインポートする

### func (*IndianPoker) IsHumanTurn

func (ip *IndianPoker) IsHumanTurn() bool

IsHumanTurn 人間のターンかチェック

### func (*IndianPoker) MarshalJSON

func (ip *IndianPoker) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*IndianPoker) PlayerAction

func (ip *IndianPoker) PlayerAction(action, amount, humanPlayMs int) error

PlayerAction 人間プレイヤーのアクション実行 humanPlayMs: 迷い時間(ms, 0=計測なし)

### func (*IndianPoker) Reset

func (ip *IndianPoker) Reset() error

Reset ゲーム初期化

### func (*IndianPoker) ResetProfile

func (ip *IndianPoker) ResetProfile()

ResetProfile メタAIプロファイルをリセットする

### func (*IndianPoker) SetActedFlags

func (ip *IndianPoker) SetActedFlags(flags []bool)

SetActedFlags actedフラグ設定 (テスト用)

### func (*IndianPoker) SetConfig

func (ip *IndianPoker) SetConfig(cfg IndianPokerConfig)

SetConfig 設定変更

### func (*IndianPoker) SetCpuActions

func (ip *IndianPoker) SetCpuActions(actions []IndianPokerCpuAction)

SetCpuActions CPU行動記録設定 (テスト用)

### func (*IndianPoker) SetCurrentTurn

func (ip *IndianPoker) SetCurrentTurn(turn int)

SetCurrentTurn 現在のターン設定 (テスト用)

### func (*IndianPoker) SetDealerIdx

func (ip *IndianPoker) SetDealerIdx(idx int)

SetDealerIdx ディーラーインデックス設定 (テスト用)

### func (*IndianPoker) SetGameEndFlag

func (ip *IndianPoker) SetGameEndFlag(flag bool)

SetGameEndFlag ゲーム終了フラグ設定 (テスト用)

### func (*IndianPoker) SetHandCount

func (ip *IndianPoker) SetHandCount(count int)

SetHandCount ハンド数設定 (テスト用)

### func (*IndianPoker) SetLastBet

func (ip *IndianPoker) SetLastBet(bet int)

SetLastBet 最後のベット設定 (テスト用)

### func (*IndianPoker) SetMinRaise

func (ip *IndianPoker) SetMinRaise(mr int)

SetMinRaise 最小レイズ額設定 (テスト用)

### func (*IndianPoker) SetPhase

func (ip *IndianPoker) SetPhase(phase int)

SetPhase フェーズ設定 (テスト用)

### func (*IndianPoker) SetPot

func (ip *IndianPoker) SetPot(pot int)

SetPot ポット設定 (テスト用)

### func (*IndianPoker) SetRaiseCount

func (ip *IndianPoker) SetRaiseCount(rc int)

SetRaiseCount レイズ回数設定 (テスト用)

### func (*IndianPoker) SetRoundResults

func (ip *IndianPoker) SetRoundResults(results []IndianPokerResult)

SetRoundResults ラウンド結果設定 (テスト用)

### func (*IndianPoker) SetSidePots

func (ip *IndianPoker) SetSidePots(pots []IndianPokerSidePot)

SetSidePots サイドポット設定 (テスト用)

### func (*IndianPoker) SetStartingChips

func (ip *IndianPoker) SetStartingChips(chips []int)

SetStartingChips ハンド開始時チップ設定 (テスト用)

### func (*IndianPoker) UnmarshalJSON

func (ip *IndianPoker) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type IndianPokerConfig

IndianPokerConfig インディアンポーカー設定

type IndianPokerConfig struct {
    Ante         int              // アンティ
    InitChips    int              // 初期チップ
    BettingLimit BettingLimitType // ベッティングリミット
    CpuMetaAI    bool             // メタAI: セッション内学習
}

### func DefaultIndianPokerConfig

func DefaultIndianPokerConfig() IndianPokerConfig

DefaultIndianPokerConfig デフォルト設定

### func (IndianPokerConfig) Validate

func (c IndianPokerConfig) Validate() error

Validate 設定値のドメインバリデーション

## type IndianPokerCpuAction

IndianPokerCpuAction CPU行動記録

type IndianPokerCpuAction struct {
    PlayerIdx int // プレイヤーインデックス
    Action    int // アクション
    Amount    int // 金額
}

## type IndianPokerHumanProfile

IndianPokerHumanProfile セッション内でインディアンポーカーにおける人間プレイヤーの行動を学習するプロファイル CPUは人間のカードが見えるため、人間のカード強度ブラケット別にアグレッシブ行動を追跡する

type IndianPokerHumanProfile struct {
    // AggressiveByBracket カード強度ブラケット別のアグレッシブ行動追跡:
    // [0]=弱(2-5), [1]=中(6-9), [2]=強(10-A)
    AggressiveByBracket [3]struct{ Aggressive, Total int }
    // FoldToBetCount ベット/レイズに対してフォールドした回数
    FoldToBetCount int
    // FoldToBetTotal ベット/レイズに対するフォールド機会の合計
    FoldToBetTotal int
    // GamesPlayed セッション内のゲーム数
    GamesPlayed int
    // HesitationCount 迷い時間の計測回数 (Welford's online algorithm)
    HesitationCount int
    // HesitationMean 迷い時間の平均 (ms)
    HesitationMean float64
    // HesitationM2 迷い時間の分散計算用 M2 (Welford's online algorithm)
    HesitationM2 float64
}

### func (*IndianPokerHumanProfile) AdaptStrength

func (p *IndianPokerHumanProfile) AdaptStrength() float64

AdaptStrength 適応強度を返す (0.0 ~ 0.2)

### func (*IndianPokerHumanProfile) AdjustedBluffChance

func (p *IndianPokerHumanProfile) AdjustedBluffChance(base float64) float64

AdjustedBluffChance 人間のフォールド率に基づいて調整済みブラフ確率を返す 人間がフォールドしやすい → CPUがブラフを増やす

### func (*IndianPokerHumanProfile) AdjustedCallChance

func (p *IndianPokerHumanProfile) AdjustedCallChance(base float64, bracket int, hesitationMs int) float64

AdjustedCallChance ブラフ率と迷い時間に基づいて調整済みコール確率を返す base: ベースコール確率, bracket: カード強度ブラケット, hesitationMs: 迷い時間(ms)

### func (*IndianPokerHumanProfile) BluffRate

func (p *IndianPokerHumanProfile) BluffRate(bracket int) float64

BluffRate 指定ブラケットのアグレッシブ率を返す (データなしの場合0.5)

### func (*IndianPokerHumanProfile) Export

func (p *IndianPokerHumanProfile) Export() IndianPokerHumanProfileData

Export プロファイルデータをJSON永続化形式でエクスポートする

### func (*IndianPokerHumanProfile) FoldRate

func (p *IndianPokerHumanProfile) FoldRate() float64

FoldRate フォールド率を返す (データなしの場合0.5)

### func (*IndianPokerHumanProfile) HesitationBoost

func (p *IndianPokerHumanProfile) HesitationBoost(ms int) float64

HesitationBoost 指定msの迷い時間に対するコール確率ブーストを返す

### func (*IndianPokerHumanProfile) HesitationStdDev

func (p *IndianPokerHumanProfile) HesitationStdDev() float64

HesitationStdDev 迷い時間の標準偏差を返す (データ不足の場合0)

### func (*IndianPokerHumanProfile) HesitationZScore

func (p *IndianPokerHumanProfile) HesitationZScore(ms int) float64

HesitationZScore 指定msの迷い時間のz-scoreを返す (データ不足の場合0)

### func (*IndianPokerHumanProfile) Import

func (p *IndianPokerHumanProfile) Import(data IndianPokerHumanProfileData)

Import JSON永続化形式のデータからプロファイルを復元する

### func (*IndianPokerHumanProfile) RecordAction

func (p *IndianPokerHumanProfile) RecordAction(cardRank, action int)

RecordAction 人間のベッティングアクションを記録する cardRank: カードランク(2-14), action: bettingAction* 定数

### func (*IndianPokerHumanProfile) RecordFoldToBet

func (p *IndianPokerHumanProfile) RecordFoldToBet(folded bool)

RecordFoldToBet ベット/レイズに対するフォールド機会を記録する

### func (*IndianPokerHumanProfile) RecordHesitation

func (p *IndianPokerHumanProfile) RecordHesitation(ms int)

RecordHesitation 迷い時間(ms)を記録する (Welford’s online algorithm) ms <= 0 の場合は何もしない (CUI等で計測不可の場合)

## type IndianPokerHumanProfileBracketData

IndianPokerHumanProfileBracketData はブラケット別アグレッシブ行動のJSON出力形式

type IndianPokerHumanProfileBracketData struct {
    Aggressive int `json:"aggressive"`
    Total      int `json:"total"`
}

## type IndianPokerHumanProfileData

IndianPokerHumanProfileData はIndianPokerHumanProfileのJSON永続化形式

type IndianPokerHumanProfileData struct {
    AggressiveByBracket [3]IndianPokerHumanProfileBracketData `json:"aggressiveByBracket"`
    FoldToBetCount      int                                   `json:"foldToBetCount"`
    FoldToBetTotal      int                                   `json:"foldToBetTotal"`
    GamesPlayed         int                                   `json:"gamesPlayed"`
    HesitationCount     int                                   `json:"hesitationCount"`
    HesitationMean      float64                               `json:"hesitationMean"`
    HesitationM2        float64                               `json:"hesitationM2"`
}

### func ImportIndianPokerHumanProfileJSON

func ImportIndianPokerHumanProfileJSON(data []byte) (IndianPokerHumanProfileData, error)

ImportIndianPokerHumanProfileJSON JSONバイトからIndianPokerHumanProfileDataをデコードする

## type IndianPokerPlayer

IndianPokerPlayer インディアンポーカープレイヤークラス

type IndianPokerPlayer struct {
    Player     // 親クラス
    ChipHolder // チップ管理
    // contains filtered or unexported fields
}

### func NewIndianPokerPlayer

func NewIndianPokerPlayer(isHuman bool, style HoldemPlayStyle) *IndianPokerPlayer

NewIndianPokerPlayer コンストラクタ

### func NewIndianPokerPlayers

func NewIndianPokerPlayers() []*IndianPokerPlayer

NewIndianPokerPlayers インディアンポーカーのプレイヤースライスを生成する (1 human + 3 CPU)

### func (*IndianPokerPlayer) GetComparisonCards

func (p *IndianPokerPlayer) GetComparisonCards() []*Card

GetComparisonCards ハンド比較用カード取得 (BettingPlayerインターフェース)

### func (*IndianPokerPlayer) GetIsHuman

func (p *IndianPokerPlayer) GetIsHuman() bool

GetIsHuman 人間フラグ取得

### func (*IndianPokerPlayer) GetPlayStyle

func (p *IndianPokerPlayer) GetPlayStyle() HoldemPlayStyle

GetPlayStyle プレイスタイル取得

### func (*IndianPokerPlayer) GetPlayStyleName

func (p *IndianPokerPlayer) GetPlayStyleName() string

GetPlayStyleName プレイスタイル名取得

### func (*IndianPokerPlayer) MarshalJSON

func (p *IndianPokerPlayer) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*IndianPokerPlayer) UnmarshalJSON

func (p *IndianPokerPlayer) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type IndianPokerResult

IndianPokerResult ショーダウン結果

type IndianPokerResult struct {
    PlayerIdx int   // プレイヤーインデックス
    Card      *Card // 公開カード
    CardRank  int   // カードランク (2-14, Ace=14)
    WonAmount int   // 獲得チップ
}

## type IndianPokerSidePot

IndianPokerSidePot サイドポット (共通SidePot型のエイリアス)

type IndianPokerSidePot = SidePot

## type Klondike

Klondike クロンダイクゲームクラス

type Klondike struct {
    // contains filtered or unexported fields
}

### func NewKlondike

func NewKlondike(trumpCards *TrumpCards) *Klondike

NewKlondike コンストラクタ

### func (*Klondike) AllFaceUp

func (k *Klondike) AllFaceUp() bool

AllFaceUp 全カードが表向きかどうか(ストックとウェイストも含む)

### func (*Klondike) AutoComplete

func (k *Klondike) AutoComplete() error

AutoComplete オートコンプリート(全カード表向きの場合に自動でファンデーションへ移動)

### func (*Klondike) CanUndo

func (k *Klondike) CanUndo() bool

CanUndo アンドゥ可能かどうか

### func (*Klondike) Draw

func (k *Klondike) Draw() error

Draw ストックからウェイストにカードを引く

### func (*Klondike) GetActionLog

func (k *Klondike) GetActionLog() []*ActionLogEntry

GetActionLog 棋譜取得

### func (*Klondike) GetDrawCount

func (k *Klondike) GetDrawCount() int

GetDrawCount ドローカウント取得

### func (*Klondike) GetFoundation

func (k *Klondike) GetFoundation() [KlondikeFoundationCnt][]*Card

GetFoundation ファンデーション取得

### func (*Klondike) GetHint

func (k *Klondike) GetHint() *KlondikeHint

GetHint ヒントを取得

### func (*Klondike) GetMoveCount

func (k *Klondike) GetMoveCount() int

GetMoveCount 移動回数取得

### func (*Klondike) GetPhase

func (k *Klondike) GetPhase() KlondikePhase

GetPhase フェーズ取得

### func (*Klondike) GetScore

func (k *Klondike) GetScore() int

GetScore スコア取得 (ベガス式: -52 + 5 * ファンデーション枚数)

### func (*Klondike) GetScoringMode

func (k *Klondike) GetScoringMode() KlondikeScoringMode

GetScoringMode スコアリングモード取得

### func (*Klondike) GetStockCount

func (k *Klondike) GetStockCount() int

GetStockCount ストック枚数取得

### func (*Klondike) GetTableau

func (k *Klondike) GetTableau() [KlondikeTableauCnt][]*KlondikeTableauCard

GetTableau タブロー取得

### func (*Klondike) GetWaste

func (k *Klondike) GetWaste() []*Card

GetWaste ウェイスト取得

### func (*Klondike) GiveUp

func (k *Klondike) GiveUp()

GiveUp ギブアップ

### func (*Klondike) IsStalemate

func (k *Klondike) IsStalemate() bool

IsStalemate 手詰まり状態取得

### func (*Klondike) MarshalJSON

func (k *Klondike) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*Klondike) MoveTableauToFoundation

func (k *Klondike) MoveTableauToFoundation(col int) error

MoveTableauToFoundation タブローからファンデーションにカードを移動

### func (*Klondike) MoveTableauToTableau

func (k *Klondike) MoveTableauToTableau(fromCol, cardIndex, toCol int) error

MoveTableauToTableau タブローからタブローにカードを移動

### func (*Klondike) MoveWasteToFoundation

func (k *Klondike) MoveWasteToFoundation() error

MoveWasteToFoundation ウェイストからファンデーションにカードを移動

### func (*Klondike) MoveWasteToTableau

func (k *Klondike) MoveWasteToTableau(col int) error

MoveWasteToTableau ウェイストからタブローにカードを移動

### func (*Klondike) Reset

func (k *Klondike) Reset()

Reset ゲームリセット

### func (*Klondike) ResetWithConfig

func (k *Klondike) ResetWithConfig(cfg KlondikeConfig)

ResetWithConfig 設定付きリセット

### func (*Klondike) SetDrawCount

func (k *Klondike) SetDrawCount(n int)

SetDrawCount ドローカウント設定 (テスト用)

### func (*Klondike) SetFoundation

func (k *Klondike) SetFoundation(foundation [KlondikeFoundationCnt][]*Card)

SetFoundation ファンデーション設定 (テスト用)

### func (*Klondike) SetIsStalemate

func (k *Klondike) SetIsStalemate(v bool)

SetIsStalemate 手詰まり状態設定 (テスト用)

### func (*Klondike) SetPhase

func (k *Klondike) SetPhase(phase KlondikePhase)

SetPhase フェーズ設定 (テスト用)

### func (*Klondike) SetScoringMode

func (k *Klondike) SetScoringMode(m KlondikeScoringMode)

SetScoringMode スコアリングモード設定 (テスト用)

### func (*Klondike) SetStock

func (k *Klondike) SetStock(stock []*Card)

SetStock ストック設定 (テスト用)

### func (*Klondike) SetTableau

func (k *Klondike) SetTableau(tableau [KlondikeTableauCnt][]*KlondikeTableauCard)

SetTableau タブロー設定 (テスト用)

### func (*Klondike) SetWaste

func (k *Klondike) SetWaste(waste []*Card)

SetWaste ウェイスト設定 (テスト用)

### func (*Klondike) Undo

func (k *Klondike) Undo() error

Undo 直前の操作を取り消す

### func (*Klondike) UndoN

func (k *Klondike) UndoN(n int) error

UndoN n回連続でアンドゥを実行する。

### func (*Klondike) UndoToEscape

func (k *Klondike) UndoToEscape() int

UndoToEscape 膠着状態から抜けるために必要なアンドゥ回数を返す。膠着状態でなければ0、脱出不可なら-1。

### func (*Klondike) UnmarshalJSON

func (k *Klondike) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type KlondikeConfig

KlondikeConfig クロンダイクゲーム設定

type KlondikeConfig struct {
    DrawCount   int
    ScoringMode KlondikeScoringMode
}

## type KlondikeHint

KlondikeHint ヒント

type KlondikeHint struct {
    FromZone  string // "waste" or "tableau"
    FromCol   int
    CardIndex int
    ToZone    string // "tableau" or "foundation"
    ToCol     int
}

## type KlondikePhase

KlondikePhase クロンダイクゲームフェーズ

type KlondikePhase int

Klondikeのフェーズ定数

const (
    // KlondikePhasePlaying プレイ中
    KlondikePhasePlaying KlondikePhase = iota
    // KlondikePhaseGameClear ゲームクリア
    KlondikePhaseGameClear
    // KlondikePhaseGameOver ゲームオーバー
    KlondikePhaseGameOver
)

## type KlondikeScoringMode

KlondikeScoringMode スコアリングモード

type KlondikeScoringMode int

Klondikeのスコアリング方式定数

const (
    // KlondikeScoringNone スコアリングなし
    KlondikeScoringNone KlondikeScoringMode = iota
    // KlondikeScoringVegas ベガススコアリング
    KlondikeScoringVegas
)

## type KlondikeTableauCard

KlondikeTableauCard タブロー上のカード

type KlondikeTableauCard struct {
    Card   *Card `json:"c"`
    FaceUp bool  `json:"f"`
}

## type Memory

Memory 神経衰弱ゲームクラス

type Memory struct {
    // contains filtered or unexported fields
}

### func NewMemory

func NewMemory(trumpCards *TrumpCards, players []*MemoryPlayer, config MemoryConfig) *Memory

NewMemory コンストラクタ

### func (*Memory) CpuFlip

func (m *Memory) CpuFlip()

CpuFlip CPUプレイヤーがカードをめくる (1ターン分: flip1 + flip2)

### func (*Memory) GetActionLog

func (m *Memory) GetActionLog() []*ActionLogEntry

GetActionLog 棋譜取得

### func (*Memory) GetBoard

func (m *Memory) GetBoard() [MemoryBoardSize]*MemoryBoardCard

GetBoard ボードカードを取得

### func (*Memory) GetBoardCard

func (m *Memory) GetBoardCard(pos int) *MemoryBoardCard

GetBoardCard 指定位置のボードカードを取得

### func (*Memory) GetConfig

func (m *Memory) GetConfig() MemoryConfig

GetConfig 設定を取得

### func (*Memory) GetCurrentPlayerIdx

func (m *Memory) GetCurrentPlayerIdx() int

GetCurrentPlayerIdx 現在のプレイヤーインデックスを取得

### func (*Memory) GetFirstFlipPos

func (m *Memory) GetFirstFlipPos() int

GetFirstFlipPos 1枚目のめくり位置を取得

### func (*Memory) GetGameEndFlag

func (m *Memory) GetGameEndFlag() bool

GetGameEndFlag ゲーム終了フラグを取得

### func (*Memory) GetLastMatchResult

func (m *Memory) GetLastMatchResult() bool

GetLastMatchResult 直前のマッチ結果を取得

### func (*Memory) GetPhase

func (m *Memory) GetPhase() MemoryPhase

GetPhase フェーズ取得

### func (*Memory) GetPlayer

func (m *Memory) GetPlayer(i int) *MemoryPlayer

GetPlayer プレイヤーを取得

### func (*Memory) GetPlayerCnt

func (m *Memory) GetPlayerCnt() int

GetPlayerCnt プレイヤー数を取得

### func (*Memory) GetSecondFlipPos

func (m *Memory) GetSecondFlipPos() int

GetSecondFlipPos 2枚目のめくり位置を取得

### func (*Memory) GetTurnNumber

func (m *Memory) GetTurnNumber() int

GetTurnNumber ターン番号取得

### func (*Memory) GetWinnerIdx

func (m *Memory) GetWinnerIdx() int

GetWinnerIdx 勝者インデックスを取得

### func (*Memory) IsHumanTurn

func (m *Memory) IsHumanTurn() bool

IsHumanTurn 人間のターンかどうか

### func (*Memory) MarshalJSON

func (m *Memory) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*Memory) PlayerFlip

func (m *Memory) PlayerFlip(pos int) error

PlayerFlip 人間プレイヤーがカードをめくる

### func (*Memory) Reset

func (m *Memory) Reset()

Reset ゲームリセット

### func (*Memory) ResolveFlip

func (m *Memory) ResolveFlip()

ResolveFlip フリップ結果を解決する

### func (*Memory) SetBoard

func (m *Memory) SetBoard(board [MemoryBoardSize]*MemoryBoardCard)

SetBoard ボード設定 (テスト用)

### func (*Memory) SetConfig

func (m *Memory) SetConfig(cfg MemoryConfig)

SetConfig 設定を設定

### func (*Memory) SetCurrentPlayerIdx

func (m *Memory) SetCurrentPlayerIdx(idx int)

SetCurrentPlayerIdx 現在のプレイヤーインデックスを設定 (テスト用)

### func (*Memory) SetPhase

func (m *Memory) SetPhase(phase MemoryPhase)

SetPhase フェーズ設定 (テスト用)

### func (*Memory) UnmarshalJSON

func (m *Memory) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type MemoryBoardCard

MemoryBoardCard ボード上のカード

type MemoryBoardCard struct {
    Card   *Card `json:"c"`
    FaceUp bool  `json:"f"`
    Taken  bool  `json:"t"`
}

## type MemoryConfig

MemoryConfig 神経衰弱ゲーム設定

type MemoryConfig struct {
    CpuDifficulty MemoryCpuDifficulty `json:"cd"`
}

### func DefaultMemoryConfig

func DefaultMemoryConfig() MemoryConfig

DefaultMemoryConfig デフォルト設定を返す

## type MemoryCpuDifficulty

MemoryCpuDifficulty CPU の難易度レベル

type MemoryCpuDifficulty int

MemoryのCPU難易度定数

const (
    // MemoryCpuDifficultyEasy 低難易度
    MemoryCpuDifficultyEasy MemoryCpuDifficulty = iota
    // MemoryCpuDifficultyNormal 中難易度
    MemoryCpuDifficultyNormal
    // MemoryCpuDifficultyHard 高難易度
    MemoryCpuDifficultyHard
)

## type MemoryEntry

MemoryEntry turnSeen を持つ記憶エントリのインターフェース

type MemoryEntry interface {
    GetTurnSeen() int
}

## type MemoryPhase

MemoryPhase 神経衰弱ゲームフェーズ

type MemoryPhase int

Memoryのフェーズ定数

const (
    // MemoryPhaseFlip1 1枚目を選択するフェーズ
    MemoryPhaseFlip1 MemoryPhase = iota
    // MemoryPhaseFlip2 2枚目を選択するフェーズ
    MemoryPhaseFlip2
    // MemoryPhaseResult マッチ結果表示フェーズ
    MemoryPhaseResult
    // MemoryPhaseGameEnd ゲーム終了
    MemoryPhaseGameEnd
)

## type MemoryPlayer

MemoryPlayer 神経衰弱プレイヤークラス

type MemoryPlayer struct {
    *GamePlayer
    // contains filtered or unexported fields
}

### func NewMemoryPlayer

func NewMemoryPlayer(isHuman bool) *MemoryPlayer

NewMemoryPlayer コンストラクタ

### func (*MemoryPlayer) AddPair

func (p *MemoryPlayer) AddPair(c1, c2 *Card)

AddPair ペアを追加

### func (*MemoryPlayer) FindAnyKnownPair

func (p *MemoryPlayer) FindAnyKnownPair() (int, int, bool)

FindAnyKnownPair 記憶の中からペアになる位置の組を探す

### func (*MemoryPlayer) FindKnownMatch

func (p *MemoryPlayer) FindKnownMatch(rank int) (int, int, bool)

FindKnownMatch 指定したrankの既知ペア位置を探す 同じrankの位置を2つ以上知っていれば最初の2つを返す

### func (*MemoryPlayer) GetMemoryCount

func (p *MemoryPlayer) GetMemoryCount() int

GetMemoryCount 記憶しているカード枚数を返す

### func (*MemoryPlayer) GetPairCount

func (p *MemoryPlayer) GetPairCount() int

GetPairCount 獲得ペア数を取得

### func (*MemoryPlayer) GetPairs

func (p *MemoryPlayer) GetPairs() [][2]*Card

GetPairs 獲得したペア一覧を取得

### func (*MemoryPlayer) MarshalJSON

func (p *MemoryPlayer) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*MemoryPlayer) RecordRevealedCard

func (p *MemoryPlayer) RecordRevealedCard(position int, rank int, retentionChance float64, turnNumber int)

RecordRevealedCard 公開されたカードを記憶する (retentionChance の確率で記録) 同じpositionの記憶が既にあれば上書きしない

### func (*MemoryPlayer) RemoveMemoryAt

func (p *MemoryPlayer) RemoveMemoryAt(position int)

RemoveMemoryAt 指定位置の記憶を削除する(カードが取られた場合)

### func (*MemoryPlayer) ResetGame

func (p *MemoryPlayer) ResetGame()

ResetGame ゲームリセット(ペア・記憶・手札をクリア)

### func (*MemoryPlayer) SetPairCount

func (p *MemoryPlayer) SetPairCount(n int)

SetPairCount 獲得ペア数を設定

### func (*MemoryPlayer) UnmarshalJSON

func (p *MemoryPlayer) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type Napoleon

Napoleon ナポレオンゲームクラス

type Napoleon struct {
    // contains filtered or unexported fields
}

### func NewNapoleon

func NewNapoleon(trumpCards *TrumpCards, players []*NapoleonPlayer, config NapoleonConfig) *Napoleon

NewNapoleon コンストラクタ

### func (*Napoleon) CpuBid

func (n *Napoleon) CpuBid()

CpuBid 現在のビッドプレイヤーがCPUの場合にビッドする

### func (*Napoleon) CpuDeclareTrump

func (n *Napoleon) CpuDeclareTrump()

CpuDeclareTrump CPUナポレオンが切り札と副官を宣言する

### func (*Napoleon) CpuExchangeKitty

func (n *Napoleon) CpuExchangeKitty()

CpuExchangeKitty CPUナポレオンが場札を交換する

### func (*Napoleon) CpuPlay

func (n *Napoleon) CpuPlay()

CpuPlay 現在の手番がCPUの場合に1ターン実行

### func (*Napoleon) GetActionLog

func (n *Napoleon) GetActionLog() []*ActionLogEntry

GetActionLog 棋譜取得

### func (*Napoleon) GetAdjutantCard

func (n *Napoleon) GetAdjutantCard() *Card

GetAdjutantCard 副官カード取得

### func (*Napoleon) GetAdjutantIdx

func (n *Napoleon) GetAdjutantIdx() int

GetAdjutantIdx 副官インデックス取得

### func (*Napoleon) GetAdjutantRevealed

func (n *Napoleon) GetAdjutantRevealed() bool

GetAdjutantRevealed 副官公開状態取得

### func (*Napoleon) GetBidPlayerIdx

func (n *Napoleon) GetBidPlayerIdx() int

GetBidPlayerIdx ビッドプレイヤーインデックス取得

### func (*Napoleon) GetConfig

func (n *Napoleon) GetConfig() NapoleonConfig

GetConfig 設定取得

### func (*Napoleon) GetCurrentPlayerIdx

func (n *Napoleon) GetCurrentPlayerIdx() int

GetCurrentPlayerIdx 現在のプレイヤーインデックス取得

### func (*Napoleon) GetCurrentTrick

func (n *Napoleon) GetCurrentTrick() []*NapoleonTrickCard

GetCurrentTrick 現在のトリック取得

### func (*Napoleon) GetGameEndFlag

func (n *Napoleon) GetGameEndFlag() bool

GetGameEndFlag ゲーム終了フラグ取得

### func (*Napoleon) GetHighestBid

func (n *Napoleon) GetHighestBid() int

GetHighestBid 現在の最高ビッド取得

### func (*Napoleon) GetHighestBidder

func (n *Napoleon) GetHighestBidder() int

GetHighestBidder 最高ビッドプレイヤー取得

### func (*Napoleon) GetHint

func (n *Napoleon) GetHint() *NapoleonHint

GetHint ヒントを取得する

### func (*Napoleon) GetKitty

func (n *Napoleon) GetKitty() []*Card

GetKitty 場札取得

### func (*Napoleon) GetLeadPlayerIdx

func (n *Napoleon) GetLeadPlayerIdx() int

GetLeadPlayerIdx リードプレイヤーインデックス取得

### func (*Napoleon) GetNapoleonIdx

func (n *Napoleon) GetNapoleonIdx() int

GetNapoleonIdx ナポレオンインデックス取得

### func (*Napoleon) GetPassCount

func (n *Napoleon) GetPassCount() int

GetPassCount パス数取得

### func (*Napoleon) GetPhase

func (n *Napoleon) GetPhase() NapoleonPhase

GetPhase 現在のフェーズ取得

### func (*Napoleon) GetPlayer

func (n *Napoleon) GetPlayer(i int) *NapoleonPlayer

GetPlayer プレイヤー取得

### func (*Napoleon) GetPlayerCnt

func (n *Napoleon) GetPlayerCnt() int

GetPlayerCnt プレイヤー数取得

### func (*Napoleon) GetRoundNumber

func (n *Napoleon) GetRoundNumber() int

GetRoundNumber 現在のラウンド番号取得

### func (*Napoleon) GetTrickNumber

func (n *Napoleon) GetTrickNumber() int

GetTrickNumber 現在のトリック番号取得

### func (*Napoleon) GetTrumpSuit

func (n *Napoleon) GetTrumpSuit() int

GetTrumpSuit 切り札スート取得

### func (*Napoleon) GetValidPlayIndices

func (n *Napoleon) GetValidPlayIndices(playerIdx int) []int

GetValidPlayIndices プレイ可能なカードのインデックスリストを返す (Web用)

### func (*Napoleon) GetWinnerTeam

func (n *Napoleon) GetWinnerTeam() int

GetWinnerTeam 勝利チーム取得 (-1 = 未確定)

### func (*Napoleon) IsHumanBidTurn

func (n *Napoleon) IsHumanBidTurn() bool

IsHumanBidTurn 現在のビッド手番が人間かどうか

### func (*Napoleon) IsHumanDeclareTurn

func (n *Napoleon) IsHumanDeclareTurn() bool

IsHumanDeclareTurn 切り札宣言が人間の番かどうか

### func (*Napoleon) IsHumanExchangeTurn

func (n *Napoleon) IsHumanExchangeTurn() bool

IsHumanExchangeTurn 場札交換が人間の番かどうか

### func (*Napoleon) IsHumanTurn

func (n *Napoleon) IsHumanTurn() bool

IsHumanTurn 現在の手番が人間かどうか

### func (*Napoleon) MarshalJSON

func (n *Napoleon) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*Napoleon) NextRound

func (n *Napoleon) NextRound()

NextRound 次のラウンドを開始する

### func (*Napoleon) NextTrick

func (n *Napoleon) NextTrick()

NextTrick 次のトリックを開始する

### func (*Napoleon) PlayerBid

func (n *Napoleon) PlayerBid(bid int) error

PlayerBid 人間プレイヤーがビッドする (0 = パス)

### func (*Napoleon) PlayerDeclareTrump

func (n *Napoleon) PlayerDeclareTrump(suit int, adjSuit int, adjVal int) error

PlayerDeclareTrump 人間プレイヤーが切り札と副官を宣言する

### func (*Napoleon) PlayerExchangeKitty

func (n *Napoleon) PlayerExchangeKitty(discardIndex int) error

PlayerExchangeKitty 人間ナポレオンが場札を交換する (捨てるカードのインデックス指定)

### func (*Napoleon) PlayerPlay

func (n *Napoleon) PlayerPlay(cardIndex int) error

PlayerPlay 人間プレイヤーがカードをプレイする

### func (*Napoleon) Reset

func (n *Napoleon) Reset()

Reset ゲーム初期化

### func (*Napoleon) ResolveTrick

func (n *Napoleon) ResolveTrick()

ResolveTrick トリックを解決して勝者を決定する

### func (*Napoleon) ScoreRound

func (n *Napoleon) ScoreRound()

ScoreRound ラウンドのスコアを確定し、ゲーム終了判定を行う

### func (*Napoleon) SetAdjutantCard

func (n *Napoleon) SetAdjutantCard(card *Card)

SetAdjutantCard 副官カード設定 (テスト用)

### func (*Napoleon) SetAdjutantIdx

func (n *Napoleon) SetAdjutantIdx(idx int)

SetAdjutantIdx 副官インデックス設定 (テスト用)

### func (*Napoleon) SetAdjutantRevealed

func (n *Napoleon) SetAdjutantRevealed(v bool)

SetAdjutantRevealed 副官公開状態設定 (テスト用)

### func (*Napoleon) SetBidPlayerIdx

func (n *Napoleon) SetBidPlayerIdx(idx int)

SetBidPlayerIdx ビッドプレイヤーインデックス設定 (テスト用)

### func (*Napoleon) SetConfig

func (n *Napoleon) SetConfig(cfg NapoleonConfig)

SetConfig 設定変更

### func (*Napoleon) SetCurrentPlayerIdx

func (n *Napoleon) SetCurrentPlayerIdx(idx int)

SetCurrentPlayerIdx プレイヤーインデックス設定 (テスト用)

### func (*Napoleon) SetCurrentTrick

func (n *Napoleon) SetCurrentTrick(trick []*NapoleonTrickCard)

SetCurrentTrick トリック設定 (テスト用)

### func (*Napoleon) SetGameEndFlag

func (n *Napoleon) SetGameEndFlag(flag bool)

SetGameEndFlag ゲーム終了フラグ設定 (テスト用)

### func (*Napoleon) SetHighestBid

func (n *Napoleon) SetHighestBid(bid int)

SetHighestBid 最高ビッド設定 (テスト用)

### func (*Napoleon) SetHighestBidder

func (n *Napoleon) SetHighestBidder(idx int)

SetHighestBidder 最高ビッドプレイヤー設定 (テスト用)

### func (*Napoleon) SetKitty

func (n *Napoleon) SetKitty(kitty []*Card)

SetKitty 場札設定 (テスト用)

### func (*Napoleon) SetLeadPlayerIdx

func (n *Napoleon) SetLeadPlayerIdx(idx int)

SetLeadPlayerIdx リードプレイヤーインデックス設定 (テスト用)

### func (*Napoleon) SetNapoleonIdx

func (n *Napoleon) SetNapoleonIdx(idx int)

SetNapoleonIdx ナポレオンインデックス設定 (テスト用)

### func (*Napoleon) SetPassCount

func (n *Napoleon) SetPassCount(cnt int)

SetPassCount パス数設定 (テスト用)

### func (*Napoleon) SetPhase

func (n *Napoleon) SetPhase(phase NapoleonPhase)

SetPhase フェーズ設定 (テスト用)

### func (*Napoleon) SetRoundNumber

func (n *Napoleon) SetRoundNumber(n2 int)

SetRoundNumber ラウンド番号設定 (テスト用)

### func (*Napoleon) SetTrickNumber

func (n *Napoleon) SetTrickNumber(t int)

SetTrickNumber トリック番号設定 (テスト用)

### func (*Napoleon) SetTrumpSuit

func (n *Napoleon) SetTrumpSuit(suit int)

SetTrumpSuit 切り札スート設定 (テスト用)

### func (*Napoleon) UnmarshalJSON

func (n *Napoleon) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type NapoleonConfig

NapoleonConfig ナポレオンゲーム設定

type NapoleonConfig struct {
    CpuDifficulty NapoleonCpuDifficulty
    MinBid        int // 最低ビッド値 (デフォルト12)
    PointLimit    int // ゲーム終了スコア (先に到達したプレイヤーが勝利)
}

### func DefaultNapoleonConfig

func DefaultNapoleonConfig() NapoleonConfig

DefaultNapoleonConfig デフォルト設定を返す

### func (NapoleonConfig) MarshalJSON

func (c NapoleonConfig) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*NapoleonConfig) UnmarshalJSON

func (c *NapoleonConfig) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

### func (NapoleonConfig) Validate

func (c NapoleonConfig) Validate() error

Validate 設定値のドメインバリデーション

## type NapoleonCpuDifficulty

NapoleonCpuDifficulty CPU の難易度レベル

type NapoleonCpuDifficulty int

ナポレオンのCPU難易度定数

const (
    // NapoleonCpuDifficultyEasy 低難易度
    NapoleonCpuDifficultyEasy NapoleonCpuDifficulty = iota
    // NapoleonCpuDifficultyNormal 中難易度
    NapoleonCpuDifficultyNormal
    // NapoleonCpuDifficultyHard 高難易度
    NapoleonCpuDifficultyHard
)

## type NapoleonHint

NapoleonHint ヒント情報

type NapoleonHint struct {
    CardIndex     *int   // 推奨カードインデックス
    Bid           *int   // 推奨ビッド値
    TrumpSuit     *int   // 推奨切り札スート
    AdjutantSuit  *int   // 推奨副官カードスート
    AdjutantValue *int   // 推奨副官カード値
    DiscardIndex  *int   // 推奨捨てカードインデックス
    Reason        string // ヒント理由キー
}

## type NapoleonPhase

NapoleonPhase ゲームフェーズ

type NapoleonPhase int

ナポレオンのフェーズ定数

const (
    // NapoleonPhaseBid ビッドフェーズ
    NapoleonPhaseBid NapoleonPhase = 0
    // NapoleonPhaseTrumpDeclaration 切り札宣言+副官指名フェーズ
    NapoleonPhaseTrumpDeclaration NapoleonPhase = 1
    // NapoleonPhaseKittyExchange 場札交換フェーズ
    NapoleonPhaseKittyExchange NapoleonPhase = 2
    // NapoleonPhasePlay トリックプレイフェーズ
    NapoleonPhasePlay NapoleonPhase = 3
    // NapoleonPhaseTrickEnd トリック終了フェーズ
    NapoleonPhaseTrickEnd NapoleonPhase = 4
    // NapoleonPhaseRoundEnd ラウンド終了フェーズ
    NapoleonPhaseRoundEnd NapoleonPhase = 5
    // NapoleonPhaseGameEnd ゲーム終了フェーズ
    NapoleonPhaseGameEnd NapoleonPhase = 6
)

## type NapoleonPlayer

NapoleonPlayer ナポレオンプレイヤークラス

type NapoleonPlayer struct {
    *GamePlayer
    RoundScoreHolder
    TrickHolder
    // contains filtered or unexported fields
}

### func NewNapoleonPlayer

func NewNapoleonPlayer(isHuman bool) *NapoleonPlayer

NewNapoleonPlayer コンストラクタ

### func (*NapoleonPlayer) GetAdjutantRevealed

func (p *NapoleonPlayer) GetAdjutantRevealed() bool

GetAdjutantRevealed 副官公開状態

### func (*NapoleonPlayer) GetBid

func (p *NapoleonPlayer) GetBid() int

GetBid ビッド取得 (-1 = 未ビッド, 0 = パス)

### func (*NapoleonPlayer) GetIsAdjutant

func (p *NapoleonPlayer) GetIsAdjutant() bool

GetIsAdjutant 副官かどうか

### func (*NapoleonPlayer) GetIsNapoleon

func (p *NapoleonPlayer) GetIsNapoleon() bool

GetIsNapoleon ナポレオンかどうか

### func (*NapoleonPlayer) GetPictureCards

func (p *NapoleonPlayer) GetPictureCards() int

GetPictureCards 獲得した絵札数

### func (*NapoleonPlayer) MarshalJSON

func (p *NapoleonPlayer) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*NapoleonPlayer) ResetRound

func (p *NapoleonPlayer) ResetRound()

ResetRound ラウンドをリセット(ビッド・トリック・手札・チーム状態を初期化)

### func (*NapoleonPlayer) SetAdjutantRevealed

func (p *NapoleonPlayer) SetAdjutantRevealed(v bool)

SetAdjutantRevealed 副官公開状態設定

### func (*NapoleonPlayer) SetBid

func (p *NapoleonPlayer) SetBid(bid int)

SetBid ビッド設定

### func (*NapoleonPlayer) SetIsAdjutant

func (p *NapoleonPlayer) SetIsAdjutant(v bool)

SetIsAdjutant 副官設定

### func (*NapoleonPlayer) SetIsNapoleon

func (p *NapoleonPlayer) SetIsNapoleon(v bool)

SetIsNapoleon ナポレオン設定

### func (*NapoleonPlayer) SetPictureCards

func (p *NapoleonPlayer) SetPictureCards(n int)

SetPictureCards 絵札数設定

### func (*NapoleonPlayer) UnmarshalJSON

func (p *NapoleonPlayer) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type NapoleonTrickCard

NapoleonTrickCard トリック中の1枚

type NapoleonTrickCard struct {
    PlayerIdx int
    Card      *Card
}

### func (*NapoleonTrickCard) MarshalJSON

func (tc *NapoleonTrickCard) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*NapoleonTrickCard) UnmarshalJSON

func (tc *NapoleonTrickCard) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type OhHell

OhHell オー・ヘルゲームクラス

type OhHell struct {
    // contains filtered or unexported fields
}

### func NewOhHell

func NewOhHell(trumpCards *TrumpCards, players []*OhHellPlayer, config OhHellConfig) *OhHell

NewOhHell コンストラクタ

### func (*OhHell) CpuBid

func (o *OhHell) CpuBid()

CpuBid 現在のビッドプレイヤーがCPUの場合にビッドする

### func (*OhHell) CpuPlay

func (o *OhHell) CpuPlay()

CpuPlay 現在の手番がCPUの場合に1ターン実行

### func (*OhHell) GetActionLog

func (o *OhHell) GetActionLog() []*ActionLogEntry

GetActionLog 棋譜取得

### func (*OhHell) GetBidPlayerIdx

func (o *OhHell) GetBidPlayerIdx() int

GetBidPlayerIdx ビッドプレイヤーインデックス取得

### func (*OhHell) GetConfig

func (o *OhHell) GetConfig() OhHellConfig

GetConfig 設定取得

### func (*OhHell) GetCurrentPlayerIdx

func (o *OhHell) GetCurrentPlayerIdx() int

GetCurrentPlayerIdx 現在のプレイヤーインデックス取得

### func (*OhHell) GetCurrentTrick

func (o *OhHell) GetCurrentTrick() []*OhHellTrickCard

GetCurrentTrick 現在のトリック取得

### func (*OhHell) GetDealerIdx

func (o *OhHell) GetDealerIdx() int

GetDealerIdx ディーラーインデックス取得

### func (*OhHell) GetGameEndFlag

func (o *OhHell) GetGameEndFlag() bool

GetGameEndFlag ゲーム終了フラグ取得

### func (*OhHell) GetHandSize

func (o *OhHell) GetHandSize() int

GetHandSize 現在のラウンドの手札枚数取得

### func (*OhHell) GetHint

func (o *OhHell) GetHint() *OhHellHint

GetHint ヒントを取得する

### func (*OhHell) GetLeadPlayerIdx

func (o *OhHell) GetLeadPlayerIdx() int

GetLeadPlayerIdx リードプレイヤーインデックス取得

### func (*OhHell) GetPhase

func (o *OhHell) GetPhase() OhHellPhase

GetPhase 現在のフェーズ取得

### func (*OhHell) GetPlayer

func (o *OhHell) GetPlayer(i int) *OhHellPlayer

GetPlayer プレイヤー取得

### func (*OhHell) GetPlayerCnt

func (o *OhHell) GetPlayerCnt() int

GetPlayerCnt プレイヤー数取得

### func (*OhHell) GetRestrictedBid

func (o *OhHell) GetRestrictedBid() int

GetRestrictedBid ディーラーが選択できないビッド値を返す (-1 = 制限なし)

### func (*OhHell) GetRoundNumber

func (o *OhHell) GetRoundNumber() int

GetRoundNumber 現在のラ���ンド番号取得

### func (*OhHell) GetTotalRounds

func (o *OhHell) GetTotalRounds() int

GetTotalRounds 総ラウンド数取得

### func (*OhHell) GetTrickNumber

func (o *OhHell) GetTrickNumber() int

GetTrickNumber 現在のトリック番号取得

### func (*OhHell) GetTrumpCard

func (o *OhHell) GetTrumpCard() *Card

GetTrumpCard 切り札カード取得

### func (*OhHell) GetTrumpSuit

func (o *OhHell) GetTrumpSuit() int

GetTrumpSuit 切り札スート取得 (-1 = 切り札なし)

### func (*OhHell) GetValidPlayIndices

func (o *OhHell) GetValidPlayIndices(playerIdx int) []int

GetValidPlayIndices プレイ可���なカードのインデックスリストを返す

### func (*OhHell) GetWinnerIdx

func (o *OhHell) GetWinnerIdx() int

GetWinnerIdx 勝者インデックス取得 (-1 = 未確定)

### func (*OhHell) IsHumanBidTurn

func (o *OhHell) IsHumanBidTurn() bool

IsHumanBidTurn 現在のビッド手番が人間かどうか

### func (*OhHell) IsHumanTurn

func (o *OhHell) IsHumanTurn() bool

IsHumanTurn 現在の手番が人間かどうか

### func (*OhHell) MarshalJSON

func (o *OhHell) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*OhHell) NextRound

func (o *OhHell) NextRound()

NextRound 次のラウンドを開始する

### func (*OhHell) NextTrick

func (o *OhHell) NextTrick()

NextTrick 次のトリックを開始する

### func (*OhHell) PlayerBid

func (o *OhHell) PlayerBid(bid int) error

PlayerBid 人間プレイヤーがビッドする

### func (*OhHell) PlayerPlay

func (o *OhHell) PlayerPlay(cardIndex int) error

PlayerPlay 人間プレイヤーがカードをプレイする

### func (*OhHell) Reset

func (o *OhHell) Reset()

Reset ゲーム初期化

### func (*OhHell) ResolveTrick

func (o *OhHell) ResolveTrick()

ResolveTrick トリックを解決して勝者を決定する

### func (*OhHell) ScoreRound

func (o *OhHell) ScoreRound()

ScoreRound ラウンドのスコアを確定し、ゲーム終了判定を行う

### func (*OhHell) SetBidPlayerIdx

func (o *OhHell) SetBidPlayerIdx(idx int)

SetBidPlayerIdx ビッドプレイヤーインデックス設定 (テスト用)

### func (*OhHell) SetConfig

func (o *OhHell) SetConfig(cfg OhHellConfig)

SetConfig 設定変更

### func (*OhHell) SetCurrentPlayerIdx

func (o *OhHell) SetCurrentPlayerIdx(idx int)

SetCurrentPlayerIdx プレイヤーインデックス設定 (テスト用)

### func (*OhHell) SetCurrentTrick

func (o *OhHell) SetCurrentTrick(trick []*OhHellTrickCard)

SetCurrentTrick トリック設定 (テスト用)

### func (*OhHell) SetDealerIdx

func (o *OhHell) SetDealerIdx(idx int)

SetDealerIdx ディーラーインデックス設定 (テスト用)

### func (*OhHell) SetHandSize

func (o *OhHell) SetHandSize(n int)

SetHandSize 手札枚数設定 (テスト用)

### func (*OhHell) SetLeadPlayerIdx

func (o *OhHell) SetLeadPlayerIdx(idx int)

SetLeadPlayerIdx リードプレイヤーインデックス設定 (テスト用)

### func (*OhHell) SetPhase

func (o *OhHell) SetPhase(phase OhHellPhase)

SetPhase フェーズ設定 (テスト用)

### func (*OhHell) SetRoundNumber

func (o *OhHell) SetRoundNumber(n int)

SetRoundNumber ラウンド番号設定 (テスト用)

### func (*OhHell) SetTotalRounds

func (o *OhHell) SetTotalRounds(n int)

SetTotalRounds 総ラウンド数設定 (テスト用)

### func (*OhHell) SetTrickNumber

func (o *OhHell) SetTrickNumber(n int)

SetTrickNumber トリック番号設定 (テスト用)

### func (*OhHell) SetTrumpSuit

func (o *OhHell) SetTrumpSuit(suit int)

SetTrumpSuit 切り札スート設定 (テスト用)

### func (*OhHell) UnmarshalJSON

func (o *OhHell) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type OhHellConfig

OhHellConfig オー・ヘルゲーム設定

type OhHellConfig struct {
    CpuDifficulty  OhHellCpuDifficulty  `json:"cd"`
    MaxHandSize    int                  `json:"mh"` // 最大手札枚数 (デフォルト10)
    ScoringVariant OhHellScoringVariant `json:"sv"`
    RoundDirection OhHellRoundDirection `json:"rd"`
}

### func DefaultOhHellConfig

func DefaultOhHellConfig() OhHellConfig

DefaultOhHellConfig デフォルト設定を返す

### func (OhHellConfig) Validate

func (c OhHellConfig) Validate() error

Validate 設定値のドメインバリデーション

## type OhHellCpuDifficulty

OhHellCpuDifficulty CPU の難易度レベル

type OhHellCpuDifficulty int

OhHellのCPU難易度定数

const (
    // OhHellCpuDifficultyEasy 低難易度
    OhHellCpuDifficultyEasy OhHellCpuDifficulty = iota
    // OhHellCpuDifficultyNormal 中難易度
    OhHellCpuDifficultyNormal
    // OhHellCpuDifficultyHard 高難易度
    OhHellCpuDifficultyHard
)

## type OhHellHint

OhHellHint ヒント情報

type OhHellHint struct {
    CardIndex *int   // 推奨カードインデックス (ビッド時nil)
    Bid       *int   // 推奨ビッド値 (プレイ時nil)
    Reason    string // ヒント理由キー
}

## type OhHellPhase

OhHellPhase ゲームフェーズ

type OhHellPhase int

OhHellのフェーズ定数

const (
    // OhHellPhaseBid ビッドフェーズ
    OhHellPhaseBid OhHellPhase = 0
    // OhHellPhasePlay トリックプレイフェーズ
    OhHellPhasePlay OhHellPhase = 1
    // OhHellPhaseTrickEnd トリック終了フェーズ
    OhHellPhaseTrickEnd OhHellPhase = 2
    // OhHellPhaseRoundEnd ラウンド終了フェーズ
    OhHellPhaseRoundEnd OhHellPhase = 3
    // OhHellPhaseGameEnd ゲーム終了フェーズ
    OhHellPhaseGameEnd OhHellPhase = 4
)

## type OhHellPlayer

OhHellPlayer オー・ヘルプレイヤークラス

type OhHellPlayer struct {
    *GamePlayer
    RoundScoreHolder
    TrickHolder
    // contains filtered or unexported fields
}

### func NewOhHellPlayer

func NewOhHellPlayer(isHuman bool) *OhHellPlayer

NewOhHellPlayer コンストラクタ

### func (*OhHellPlayer) GetBid

func (p *OhHellPlayer) GetBid() int

GetBid ビッド取得 (-1 = 未ビッド)

### func (*OhHellPlayer) MarshalJSON

func (p *OhHellPlayer) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*OhHellPlayer) ResetRound

func (p *OhHellPlayer) ResetRound()

ResetRound ラウンドをリセット(ビッド・トリック・手札・終了状態を初期化)

### func (*OhHellPlayer) SetBid

func (p *OhHellPlayer) SetBid(bid int)

SetBid ビッド設定

### func (*OhHellPlayer) UnmarshalJSON

func (p *OhHellPlayer) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type OhHellRoundDirection

OhHellRoundDirection ラウンド進行方向

type OhHellRoundDirection int

OhHellのラウンド方向定数

const (
    // OhHellRoundDownOnly 手札枚数が減少のみ (max→1)
    OhHellRoundDownOnly OhHellRoundDirection = iota
    // OhHellRoundDownAndUp 手札枚数が減少後増加 (max→1→max)
    OhHellRoundDownAndUp
)

## type OhHellScoringVariant

OhHellScoringVariant スコアリング方式

type OhHellScoringVariant int

OhHellのスコアリング定数

const (
    // OhHellScoringStandard 正確なビッド = 10+bid, 外れ = 0
    OhHellScoringStandard OhHellScoringVariant = iota
    // OhHellScoringPenalty 正確なビッド = 10+bid, 外れ = -|差分|
    OhHellScoringPenalty
)

## type OhHellTrickCard

OhHellTrickCard トリック中の1枚

type OhHellTrickCard struct {
    PlayerIdx int   `json:"pi"`
    Card      *Card `json:"c"`
}

## type OldMaid

OldMaid ババ抜きゲームクラス

type OldMaid struct {
    // contains filtered or unexported fields
}

### func NewOldMaid

func NewOldMaid(trumpCards *TrumpCards, players []*OldMaidPlayer) *OldMaid

NewOldMaid コンストラクタ

### func (*OldMaid) ArrangeTargetForHumanDraw

func (o *OldMaid) ArrangeTargetForHumanDraw()

ArrangeTargetForHumanDraw CPU心理戦: 人間が引く前に対象CPUの奇数カードを端に配置する

### func (*OldMaid) CpuDraw

func (o *OldMaid) CpuDraw() error

CpuDraw 現在の手番がCPUの場合に1ターン実行

### func (*OldMaid) ExportProfile

func (o *OldMaid) ExportProfile() interface{}

ExportProfile メタAIプロファイルをエクスポートする (プロファイルがない場合はnil)

### func (*OldMaid) GetActionLog

func (o *OldMaid) GetActionLog() []*ActionLogEntry

GetActionLog 棋譜を取得する

### func (*OldMaid) GetConfig

func (o *OldMaid) GetConfig() OldMaidConfig

GetConfig ゲーム設定取得

### func (*OldMaid) GetCpuActions

func (o *OldMaid) GetCpuActions() []*OldMaidCpuAction

GetCpuActions CPUターンの行動履歴取得

### func (*OldMaid) GetCpuHighlightedCardIdx

func (o *OldMaid) GetCpuHighlightedCardIdx() int

GetCpuHighlightedCardIdx CPU心理戦で強調された奇数カードの位置取得 (-1=なし)

### func (*OldMaid) GetCurrentTurn

func (o *OldMaid) GetCurrentTurn() int

GetCurrentTurn 現在の手番プレイヤーインデックス取得

### func (*OldMaid) GetDrawHistory

func (o *OldMaid) GetDrawHistory() []*OldMaidDrawHistoryEntry

GetDrawHistory ゲーム全体の引き履歴取得

### func (*OldMaid) GetGameEndFlag

func (o *OldMaid) GetGameEndFlag() bool

GetGameEndFlag ゲーム終了フラグ取得

### func (*OldMaid) GetHasDrawn

func (o *OldMaid) GetHasDrawn() bool

GetHasDrawn 引きが発生したかどうか

### func (*OldMaid) GetHumanAction

func (o *OldMaid) GetHumanAction() *OldMaidCpuAction

GetHumanAction 人間プレイヤーの最後の行動記録取得

### func (*OldMaid) GetHumanHandDirty

func (o *OldMaid) GetHumanHandDirty() bool

GetHumanHandDirty 人間がシャッフル/並び替えしたか

### func (*OldMaid) GetHumanProfile

func (o *OldMaid) GetHumanProfile() *OldMaidHumanProfile

GetHumanProfile メタAIプロファイル取得

### func (*OldMaid) GetLastDiscardedCards

func (o *OldMaid) GetLastDiscardedCards() []*Card

GetLastDiscardedCards 最後に捨てたカード取得

### func (*OldMaid) GetLastDiscardedPairs

func (o *OldMaid) GetLastDiscardedPairs() int

GetLastDiscardedPairs 最後に捨てたペア数

### func (*OldMaid) GetLastDrawCard

func (o *OldMaid) GetLastDrawCard() *Card

GetLastDrawCard 最後に引いたカード

### func (*OldMaid) GetLastDrawFromIdx

func (o *OldMaid) GetLastDrawFromIdx() int

GetLastDrawFromIdx 最後に引いた相手のインデックス

### func (*OldMaid) GetLastDrawPlayerIdx

func (o *OldMaid) GetLastDrawPlayerIdx() int

GetLastDrawPlayerIdx 最後に引いたプレイヤーのインデックス

### func (*OldMaid) GetLoserIdx

func (o *OldMaid) GetLoserIdx() int

GetLoserIdx 負けプレイヤーインデックス取得

### func (*OldMaid) GetNextDrawTargetIdx

func (o *OldMaid) GetNextDrawTargetIdx() int

GetNextDrawTargetIdx 現在の手番プレイヤーが引く相手のインデックス取得

### func (*OldMaid) GetPlayer

func (o *OldMaid) GetPlayer(idx int) *OldMaidPlayer

GetPlayer プレイヤー取得

### func (*OldMaid) GetPlayerCnt

func (o *OldMaid) GetPlayerCnt() int

GetPlayerCnt プレイヤー数取得

### func (*OldMaid) GetRemovedCard

func (o *OldMaid) GetRemovedCard() *Card

GetRemovedCard ジジ抜きで除外されたカード取得

### func (*OldMaid) ImportProfile

func (o *OldMaid) ImportProfile(data []byte) error

ImportProfile JSONバイトからメタAIプロファイルをインポートする

### func (*OldMaid) IsHumanTurn

func (o *OldMaid) IsHumanTurn() bool

IsHumanTurn 現在の手番が人間かどうか

### func (*OldMaid) MarshalJSON

func (o *OldMaid) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*OldMaid) PlayerDraw

func (o *OldMaid) PlayerDraw(cardIdx int) error

PlayerDraw 人間プレイヤーがカードを引く cardIdx: 引くカードのインデックス。-1 の場合はランダム選択。

### func (*OldMaid) ReorderHumanHand

func (o *OldMaid) ReorderHumanHand(indices []int) error

ReorderHumanHand 人間プレイヤーの手札を指定された順番に並び替える

### func (*OldMaid) Reset

func (o *OldMaid) Reset()

Reset ゲーム初期化

### func (*OldMaid) ResetProfile

func (o *OldMaid) ResetProfile()

ResetProfile メタAIプロファイルをリセットする

### func (*OldMaid) SetConfig

func (o *OldMaid) SetConfig(config OldMaidConfig)

SetConfig ゲーム設定をセット

### func (*OldMaid) ShuffleHumanHand

func (o *OldMaid) ShuffleHumanHand() error

ShuffleHumanHand 人間プレイヤーの手札をシャッフルする

### func (*OldMaid) UnmarshalJSON

func (o *OldMaid) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type OldMaidConfig

OldMaidConfig ババ抜き設定

type OldMaidConfig struct {
    Mode                 OldMaidMode
    CpuPlacementStrategy bool // CPU心理戦: 奇数カードを端に配置
    CpuMemoryAI          bool // CPU記憶AI: 引いた位置を記憶して戦略的に選択
    CpuHesitationEnabled bool // CPU迷い時間ディレイ
    CpuMetaAI            bool // メタAI: セッション内学習
}

### func DefaultOldMaidConfig

func DefaultOldMaidConfig() OldMaidConfig

DefaultOldMaidConfig デフォルト設定を返す

### func (OldMaidConfig) MarshalJSON

func (c OldMaidConfig) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*OldMaidConfig) UnmarshalJSON

func (c *OldMaidConfig) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

### func (OldMaidConfig) Validate

func (c OldMaidConfig) Validate() error

Validate 設定値のドメインバリデーション

## type OldMaidCpuAction

OldMaidCpuAction CPUの1ターン分の行動記録

type OldMaidCpuAction struct {
    DrawPlayerIdx  int     // 引いたプレイヤーインデックス
    DrawFromIdx    int     // 引かれた相手のインデックス
    DrawnCard      *Card   // 引いたカード
    DiscardedPairs int     // 捨てたペア数
    DiscardedCards []*Card // 捨てたカード
    HesitationMs   int     // 迷い時間ディレイ (ミリ秒; 0=無効)
}

### func (*OldMaidCpuAction) MarshalJSON

func (a *OldMaidCpuAction) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*OldMaidCpuAction) UnmarshalJSON

func (a *OldMaidCpuAction) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type OldMaidDrawHistoryEntry

OldMaidDrawHistoryEntry ゲーム全体の引き履歴の1エントリ

type OldMaidDrawHistoryEntry struct {
    DrawPlayerIdx  int  // 引いたプレイヤーインデックス
    DrawFromIdx    int  // 引かれた相手のインデックス
    DiscardedPairs int  // 捨てたペア数
    DrawerFinished bool // 引いた側が上がったか
    TargetFinished bool // 引かれた側が上がったか
}

### func (*OldMaidDrawHistoryEntry) MarshalJSON

func (e *OldMaidDrawHistoryEntry) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*OldMaidDrawHistoryEntry) UnmarshalJSON

func (e *OldMaidDrawHistoryEntry) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type OldMaidHumanProfile

OldMaidHumanProfile セッション内で人間プレイヤーの行動を学習するプロファイル

type OldMaidHumanProfile struct {
    // PositionBuckets 位置別のピック追跡: [0]=先頭1/3, [1]=中央1/3, [2]=末尾1/3
    PositionBuckets [3]int
    // TotalPicks 合計ピック数
    TotalPicks int
    // ShuffleCount シャッフル回数
    ShuffleCount int
    // DrawCount 引いた回数
    DrawCount int
    // GamesPlayed セッション内のゲーム数
    GamesPlayed int
}

### func (*OldMaidHumanProfile) AdaptStrength

func (p *OldMaidHumanProfile) AdaptStrength() float64

AdaptStrength 適応強度を返す (0.0 ~ 0.2)

### func (*OldMaidHumanProfile) Export

func (p *OldMaidHumanProfile) Export() OldMaidHumanProfileData

Export プロファイルデータをJSON永続化形式でエクスポートする

### func (*OldMaidHumanProfile) Import

func (p *OldMaidHumanProfile) Import(data OldMaidHumanProfileData)

Import JSON永続化形式のデータからプロファイルを復元する

### func (*OldMaidHumanProfile) PickRate

func (p *OldMaidHumanProfile) PickRate(bucket int) float64

PickRate 指定バケットのピック率を返す (データなしの場合1/3)

### func (*OldMaidHumanProfile) RecordDraw

func (p *OldMaidHumanProfile) RecordDraw()

RecordDraw 引きを記録する

### func (*OldMaidHumanProfile) RecordPick

func (p *OldMaidHumanProfile) RecordPick(cardIdx, handSize int)

RecordPick カードピックを記録する

### func (*OldMaidHumanProfile) RecordShuffle

func (p *OldMaidHumanProfile) RecordShuffle()

RecordShuffle シャッフルを記録する

### func (*OldMaidHumanProfile) ShuffleRate

func (p *OldMaidHumanProfile) ShuffleRate() float64

ShuffleRate シャッフル率を返す (draws == 0 の場合0.0)

### func (*OldMaidHumanProfile) StrategicPlacement

func (p *OldMaidHumanProfile) StrategicPlacement(size int) int

StrategicPlacement 奇数カードの戦略的配置位置を返す 最もピックされにくいゾーンに配置する。 適応強度が低い場合やシャッフル率が高い場合はランダムな端に配置する。

## type OldMaidHumanProfileData

OldMaidHumanProfileData はOldMaidHumanProfileのJSON永続化形式

type OldMaidHumanProfileData struct {
    PositionBuckets [3]int `json:"positionBuckets"`
    TotalPicks      int    `json:"totalPicks"`
    ShuffleCount    int    `json:"shuffleCount"`
    DrawCount       int    `json:"drawCount"`
    GamesPlayed     int    `json:"gamesPlayed"`
}

### func ImportOldMaidHumanProfileJSON

func ImportOldMaidHumanProfileJSON(data []byte) (OldMaidHumanProfileData, error)

ImportOldMaidHumanProfileJSON JSONバイトからOldMaidHumanProfileDataをデコードする

## type OldMaidMode

OldMaidMode ババ抜きモード

type OldMaidMode int

OldMaidのゲームモード定数

const (
    OldMaidModeNormal   OldMaidMode = iota // ババ抜き: ジョーカーが奇数カード
    OldMaidModeJijiNuki                    // ジジ抜き: ランダム1枚除外
)

## type OldMaidPlayer

OldMaidPlayer ババ抜きプレイヤークラス

type OldMaidPlayer struct {
    *GamePlayer
    // contains filtered or unexported fields
}

### func NewOldMaidPlayer

func NewOldMaidPlayer(isHuman bool) *OldMaidPlayer

NewOldMaidPlayer コンストラクタ

### func (*OldMaidPlayer) DiscardPairs

func (p *OldMaidPlayer) DiscardPairs() ([]*Card, int)

DiscardPairs ペアのカードを捨てる (捨てたカードとペア数を返す)

### func (*OldMaidPlayer) GetMemGotPair

func (p *OldMaidPlayer) GetMemGotPair() bool

GetMemGotPair 最後に引いたカードでペアができたか取得

### func (*OldMaidPlayer) GetMemLastDrawPos

func (p *OldMaidPlayer) GetMemLastDrawPos() int

GetMemLastDrawPos 最後に引いたカードの位置取得

### func (*OldMaidPlayer) MarshalJSON

func (p *OldMaidPlayer) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*OldMaidPlayer) ResetDrawMemory

func (p *OldMaidPlayer) ResetDrawMemory()

ResetDrawMemory 引きの記憶をリセット

### func (*OldMaidPlayer) SetMemGotPair

func (p *OldMaidPlayer) SetMemGotPair(v bool)

SetMemGotPair 最後に引いたカードでペアができたか設定

### func (*OldMaidPlayer) SetMemLastDrawPos

func (p *OldMaidPlayer) SetMemLastDrawPos(pos int)

SetMemLastDrawPos 最後に引いたカードの位置設定

### func (*OldMaidPlayer) UnmarshalJSON

func (p *OldMaidPlayer) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type Omaha

Omaha オマハホールデムクラス

type Omaha struct {
    // contains filtered or unexported fields
}

### func NewOmaha

func NewOmaha(trumpCards *TrumpCards, players []*OmahaPlayer, config OmahaConfig) *Omaha

NewOmaha コンストラクタ

### func (*Omaha) Addon

func (o *Omaha) Addon() error

Addon 人間プレイヤーがアドオンを実行する

### func (*Omaha) ExportProfile

func (o *Omaha) ExportProfile() interface{}

ExportProfile メタAIプロファイルをエクスポートする (プロファイルがない場合はnil)

### func (*Omaha) GetActedFlags

func (o *Omaha) GetActedFlags() []bool

GetActedFlags actedフラグ取得

### func (*Omaha) GetActionLog

func (o *Omaha) GetActionLog() []*ActionLogEntry

GetActionLog 棋譜を取得する

### func (*Omaha) GetAddonUsed

func (o *Omaha) GetAddonUsed() []bool

GetAddonUsed プレイヤーごとのアドオン使用フラグ取得

### func (*Omaha) GetCommunityCards

func (o *Omaha) GetCommunityCards() []*Card

GetCommunityCards コミュニティカード取得

### func (*Omaha) GetConfig

func (o *Omaha) GetConfig() OmahaConfig

GetConfig 設定取得

### func (*Omaha) GetCpuActions

func (o *Omaha) GetCpuActions() []OmahaCpuAction

GetCpuActions CPU行動記録取得

### func (*Omaha) GetCurrentTurn

func (o *Omaha) GetCurrentTurn() int

GetCurrentTurn 現在のターン取得

### func (*Omaha) GetDealerIdx

func (o *Omaha) GetDealerIdx() int

GetDealerIdx ディーラーインデックス取得

### func (*Omaha) GetEquity

func (o *Omaha) GetEquity() *HoldemEquityResult

GetEquity エクイティ計算結果を返す

### func (*Omaha) GetGameEndFlag

func (o *Omaha) GetGameEndFlag() bool

GetGameEndFlag ゲーム終了フラグ取得

### func (*Omaha) GetHandCount

func (o *Omaha) GetHandCount() int

GetHandCount ハンド数取得

### func (*Omaha) GetHumanProfile

func (o *Omaha) GetHumanProfile() *BettingHumanProfile

GetHumanProfile メタAIプロファイル取得

### func (*Omaha) GetLastBet

func (o *Omaha) GetLastBet() int

GetLastBet 最後のベット取得

### func (*Omaha) GetLastCpuError

func (o *Omaha) GetLastCpuError() error

GetLastCpuError 最後のCPUアクションエラー取得

### func (*Omaha) GetMinRaise

func (o *Omaha) GetMinRaise() int

GetMinRaise 最小レイズ額取得

### func (*Omaha) GetPhase

func (o *Omaha) GetPhase() int

GetPhase フェーズ取得

### func (*Omaha) GetPlayer

func (o *Omaha) GetPlayer(i int) *OmahaPlayer

GetPlayer 指定プレイヤー取得

### func (*Omaha) GetPlayerCnt

func (o *Omaha) GetPlayerCnt() int

GetPlayerCnt プレイヤー数取得

### func (*Omaha) GetPlayers

func (o *Omaha) GetPlayers() []*OmahaPlayer

GetPlayers プレイヤー一覧取得

### func (*Omaha) GetPot

func (o *Omaha) GetPot() int

GetPot ポット取得

### func (*Omaha) GetPotOdds

func (o *Omaha) GetPotOdds() float64

GetPotOdds ポットオッズを返す

### func (*Omaha) GetRaiseCount

func (o *Omaha) GetRaiseCount() int

GetRaiseCount 現在のレイズ回数取得

### func (*Omaha) GetRebuyCounts

func (o *Omaha) GetRebuyCounts() []int

GetRebuyCounts プレイヤーごとのリバイ回数取得

### func (*Omaha) GetRebuyPhaseType

func (o *Omaha) GetRebuyPhaseType() int

GetRebuyPhaseType リバイフェーズ種別取得

### func (*Omaha) GetRoundResults

func (o *Omaha) GetRoundResults() []OmahaResult

GetRoundResults ラウンド結果取得

### func (*Omaha) GetSidePots

func (o *Omaha) GetSidePots() []OmahaSidePot

GetSidePots サイドポット取得

### func (*Omaha) ImportProfile

func (o *Omaha) ImportProfile(data []byte) error

ImportProfile JSONバイトからメタAIプロファイルをインポートする

### func (*Omaha) IsAddonAvailable

func (o *Omaha) IsAddonAvailable() bool

IsAddonAvailable 人間プレイヤーがアドオン可能かどうか

### func (*Omaha) IsHumanTurn

func (o *Omaha) IsHumanTurn() bool

IsHumanTurn 人間のターンかチェック

### func (*Omaha) IsMuckAvailable

func (o *Omaha) IsMuckAvailable() bool

IsMuckAvailable 人間プレイヤーがマック可能かどうか

### func (*Omaha) IsRebuyAvailable

func (o *Omaha) IsRebuyAvailable() bool

IsRebuyAvailable 人間プレイヤーがリバイ可能かどうか

### func (*Omaha) MarshalJSON

func (o *Omaha) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*Omaha) Muck

func (o *Omaha) Muck() error

Muck 人間プレイヤーがハンドをマックする

### func (*Omaha) PlayerAction

func (o *Omaha) PlayerAction(action, amount, humanPlayMs int) error

PlayerAction 人間プレイヤーのアクション実行 humanPlayMs: 迷い時間(ms, 0=計測なし)

### func (*Omaha) Rebuy

func (o *Omaha) Rebuy() error

Rebuy 人間プレイヤーがリバイを実行する

### func (*Omaha) Reset

func (o *Omaha) Reset() error

Reset ゲーム初期化

### func (*Omaha) ResetProfile

func (o *Omaha) ResetProfile()

ResetProfile メタAIプロファイルをリセットする

### func (*Omaha) Resize

func (o *Omaha) Resize(players []*OmahaPlayer)

Resize プレイヤースライスを差し替え、プレイヤー数依存スライスを再初期化する

### func (*Omaha) SetConfig

func (o *Omaha) SetConfig(cfg OmahaConfig)

SetConfig 設定変更

### func (*Omaha) ShowHand

func (o *Omaha) ShowHand() error

ShowHand 人間プレイヤーがハンドを公開する

### func (*Omaha) SkipAddon

func (o *Omaha) SkipAddon() error

SkipAddon 人間プレイヤーがアドオンを辞退する

### func (*Omaha) SkipRebuy

func (o *Omaha) SkipRebuy() error

SkipRebuy 人間プレイヤーがリバイを辞退する

### func (*Omaha) UnmarshalJSON

func (o *Omaha) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type OmahaConfig

OmahaConfig オマハホールデム設定 (HoldemConfigと同一構造)

type OmahaConfig = HoldemConfig

### func DefaultOmahaConfig

func DefaultOmahaConfig() OmahaConfig

DefaultOmahaConfig デフォルト設定

## type OmahaCpuAction

OmahaCpuAction CPU行動記録

type OmahaCpuAction = HoldemCpuAction

## type OmahaPlayStyle

OmahaPlayStyle CPUプレイスタイル (HoldemPlayStyleと同一)

type OmahaPlayStyle = HoldemPlayStyle

## type OmahaPlayer

OmahaPlayer オマハホールデムプレイヤークラス

type OmahaPlayer struct {
    Player     // 親クラス
    ChipHolder // チップ管理
    // contains filtered or unexported fields
}

### func NewOmahaPlayer

func NewOmahaPlayer(isHuman bool, style HoldemPlayStyle) *OmahaPlayer

NewOmahaPlayer コンストラクタ

### func NewOmahaPlayersForTable

func NewOmahaPlayersForTable(tableSize int) []*OmahaPlayer

NewOmahaPlayersForTable 指定されたテーブルサイズに応じたオマハプレイヤースライスを生成する

### func (*OmahaPlayer) EvalBestHand

func (op *OmahaPlayer) EvalBestHand(communityCards []*Card) int

EvalBestHand コミュニティカードとホールカード(4枚)からベスト5枚を評価 オマハルール: ホールカードから必ず2枚、コミュニティカードから必ず3枚を使う

### func (*OmahaPlayer) GetAFDisplay

func (op *OmahaPlayer) GetAFDisplay() string

GetAFDisplay AF表示文字列取得 (“-”=アクションなし, “∞”=コールなし, “X.X”=通常)

### func (*OmahaPlayer) GetBestHand

func (op *OmahaPlayer) GetBestHand() []*Card

GetBestHand ベストハンド取得

### func (*OmahaPlayer) GetComparisonCards

func (op *OmahaPlayer) GetComparisonCards() []*Card

GetComparisonCards ハンド比較用カード取得 (BettingPlayerインターフェース)

### func (*OmahaPlayer) GetIsHuman

func (op *OmahaPlayer) GetIsHuman() bool

GetIsHuman 人間フラグ取得

### func (*OmahaPlayer) GetPFR

func (op *OmahaPlayer) GetPFR() int

GetPFR PFR%取得 (0 if totalHands==0)

### func (*OmahaPlayer) GetPFRCount

func (op *OmahaPlayer) GetPFRCount() int

GetPFRCount PFR対象ハンド数取得

### func (*OmahaPlayer) GetPlayStyle

func (op *OmahaPlayer) GetPlayStyle() HoldemPlayStyle

GetPlayStyle プレイスタイル取得

### func (*OmahaPlayer) GetPlayStyleName

func (op *OmahaPlayer) GetPlayStyleName() string

GetPlayStyleName プレイスタイル名取得

### func (*OmahaPlayer) GetPostFlopBetRaise

func (op *OmahaPlayer) GetPostFlopBetRaise() int

GetPostFlopBetRaise ポストフロップ ベット+レイズ回数取得

### func (*OmahaPlayer) GetPostFlopCall

func (op *OmahaPlayer) GetPostFlopCall() int

GetPostFlopCall ポストフロップ コール回数取得

### func (*OmahaPlayer) GetThreeBet

func (op *OmahaPlayer) GetThreeBet() int

GetThreeBet 3Bet%取得 (0 if threeBetOpportunity==0)

### func (*OmahaPlayer) GetThreeBetCount

func (op *OmahaPlayer) GetThreeBetCount() int

GetThreeBetCount 3Bet実行数取得

### func (*OmahaPlayer) GetThreeBetOpportunity

func (op *OmahaPlayer) GetThreeBetOpportunity() int

GetThreeBetOpportunity 3Bet機会数取得

### func (*OmahaPlayer) GetTotalHands

func (op *OmahaPlayer) GetTotalHands() int

GetTotalHands 総ハンド数取得

### func (*OmahaPlayer) GetVPIP

func (op *OmahaPlayer) GetVPIP() int

GetVPIP VPIP%取得 (0 if totalHands==0)

### func (*OmahaPlayer) GetVPIPCount

func (op *OmahaPlayer) GetVPIPCount() int

GetVPIPCount VPIP対象ハンド数取得

### func (*OmahaPlayer) IncrementPFR

func (op *OmahaPlayer) IncrementPFR()

IncrementPFR PFR対象ハンド数をインクリメント

### func (*OmahaPlayer) IncrementPostFlopBetRaise

func (op *OmahaPlayer) IncrementPostFlopBetRaise()

IncrementPostFlopBetRaise ポストフロップ ベット+レイズ回数をインクリメント

### func (*OmahaPlayer) IncrementPostFlopCall

func (op *OmahaPlayer) IncrementPostFlopCall()

IncrementPostFlopCall ポストフロップ コール回数をインクリメント

### func (*OmahaPlayer) IncrementThreeBet

func (op *OmahaPlayer) IncrementThreeBet()

IncrementThreeBet 3Bet実行数をインクリメント

### func (*OmahaPlayer) IncrementThreeBetOpportunity

func (op *OmahaPlayer) IncrementThreeBetOpportunity()

IncrementThreeBetOpportunity 3Bet機会数をインクリメント

### func (*OmahaPlayer) IncrementTotalHands

func (op *OmahaPlayer) IncrementTotalHands()

IncrementTotalHands 総ハンド数をインクリメント

### func (*OmahaPlayer) IncrementVPIP

func (op *OmahaPlayer) IncrementVPIP()

IncrementVPIP VPIP対象ハンド数をインクリメント

### func (*OmahaPlayer) MarshalJSON

func (op *OmahaPlayer) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*OmahaPlayer) UnmarshalJSON

func (op *OmahaPlayer) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type OmahaResult

OmahaResult ショーダウン結果

type OmahaResult = HoldemResult

## type OmahaSidePot

OmahaSidePot サイドポット (共通SidePot型のエイリアス)

type OmahaSidePot = SidePot

## type PigsTail

PigsTail ぶたのしっぽゲームクラス

type PigsTail struct {
    // contains filtered or unexported fields
}

### func NewPigsTail

func NewPigsTail(trumpCards *TrumpCards, players []*PigsTailPlayer) *PigsTail

NewPigsTail コンストラクタ

### func (*PigsTail) CpuAction

func (pt *PigsTail) CpuAction() error

CpuAction CPUプレイヤーが1ターン実行

### func (*PigsTail) GetActionLog

func (pt *PigsTail) GetActionLog() []*ActionLogEntry

GetActionLog 棋譜を取得する

### func (*PigsTail) GetCenter

func (pt *PigsTail) GetCenter() []*Card

GetCenter 中央の場札を取得する

### func (*PigsTail) GetCenterTopCard

func (pt *PigsTail) GetCenterTopCard() *Card

GetCenterTopCard 場札の一番上のカードを取得する (空ならnil)

### func (*PigsTail) GetCircleCount

func (pt *PigsTail) GetCircleCount() int

GetCircleCount 山札の残り枚数を取得する

### func (*PigsTail) GetConfig

func (pt *PigsTail) GetConfig() PigsTailConfig

GetConfig ゲーム設定取得

### func (*PigsTail) GetCpuActions

func (pt *PigsTail) GetCpuActions() []*PigsTailCpuAction

GetCpuActions CPUターンの行動履歴を取得する

### func (*PigsTail) GetCurrentTurn

func (pt *PigsTail) GetCurrentTurn() int

GetCurrentTurn 現在の手番プレイヤーインデックスを取得する

### func (*PigsTail) GetGameEndFlag

func (pt *PigsTail) GetGameEndFlag() bool

GetGameEndFlag ゲーム終了フラグを取得する

### func (*PigsTail) GetHumanAction

func (pt *PigsTail) GetHumanAction() *PigsTailCpuAction

GetHumanAction 人間の最後の行動記録を取得する

### func (*PigsTail) GetLastDrawCard

func (pt *PigsTail) GetLastDrawCard() *Card

GetLastDrawCard 最後に引いたカードを取得する

### func (*PigsTail) GetLastPenalty

func (pt *PigsTail) GetLastPenalty() bool

GetLastPenalty 最後のアクションでペナルティが発生したかを取得する

### func (*PigsTail) GetLoserIdx

func (pt *PigsTail) GetLoserIdx() int

GetLoserIdx 負けプレイヤーインデックスを取得する

### func (*PigsTail) GetPlayer

func (pt *PigsTail) GetPlayer(i int) *PigsTailPlayer

GetPlayer 指定インデックスのプレイヤーを取得する

### func (*PigsTail) GetPlayerCnt

func (pt *PigsTail) GetPlayerCnt() int

GetPlayerCnt プレイヤー数を取得する

### func (*PigsTail) IsHumanTurn

func (pt *PigsTail) IsHumanTurn() bool

IsHumanTurn 現在の手番が人間かを返す

### func (*PigsTail) MarshalJSON

func (pt *PigsTail) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*PigsTail) PlayerAction

func (pt *PigsTail) PlayerAction(_ int) error

PlayerAction 人間プレイヤーのアクション (山札から1枚引く)

### func (*PigsTail) Reset

func (pt *PigsTail) Reset()

Reset ゲーム初期化

### func (*PigsTail) SetConfig

func (pt *PigsTail) SetConfig(config PigsTailConfig)

SetConfig ゲーム設定をセット

### func (*PigsTail) UnmarshalJSON

func (pt *PigsTail) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type PigsTailConfig

PigsTailConfig ぶたのしっぽ設定

type PigsTailConfig struct {
    CpuHesitationEnabled bool // CPU迷い時間ディレイ
}

### func DefaultPigsTailConfig

func DefaultPigsTailConfig() PigsTailConfig

DefaultPigsTailConfig デフォルト設定を返す

### func (PigsTailConfig) MarshalJSON

func (c PigsTailConfig) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*PigsTailConfig) UnmarshalJSON

func (c *PigsTailConfig) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

### func (PigsTailConfig) Validate

func (c PigsTailConfig) Validate() error

Validate 設定値のドメインバリデーション

## type PigsTailCpuAction

PigsTailCpuAction CPUの1ターン分の行動記録

type PigsTailCpuAction struct {
    DrawPlayerIdx int   // 引いたプレイヤーインデックス
    DrawnCard     *Card // 引いたカード
    PenaltyFlag   bool  // ペナルティが発生したか
    PenaltyCount  int   // 引き取ったカード枚数
    HesitationMs  int   // 迷い時間ディレイ (ミリ秒; 0=無効)
}

### func (*PigsTailCpuAction) MarshalJSON

func (a *PigsTailCpuAction) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*PigsTailCpuAction) UnmarshalJSON

func (a *PigsTailCpuAction) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type PigsTailPlayer

PigsTailPlayer ぶたのしっぽプレイヤークラス

type PigsTailPlayer struct {
    *GamePlayer
}

### func NewPigsTailPlayer

func NewPigsTailPlayer(isHuman bool) *PigsTailPlayer

NewPigsTailPlayer コンストラクタ

### func (*PigsTailPlayer) MarshalJSON

func (p *PigsTailPlayer) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*PigsTailPlayer) UnmarshalJSON

func (p *PigsTailPlayer) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type Pineapple

Pineapple パイナップルポーカー (Crazy Pineapple) クラス ホールカード3枚を配り、フロップ後に1枚をディスカードする

type Pineapple struct {
    // contains filtered or unexported fields
}

### func NewPineapple

func NewPineapple(trumpCards *TrumpCards, players []*PineapplePlayer, config PineappleConfig) *Pineapple

NewPineapple コンストラクタ

### func (*Pineapple) Addon

func (p *Pineapple) Addon() error

Addon 人間プレイヤーがアドオンを実行する

### func (*Pineapple) DiscardCard

func (p *Pineapple) DiscardCard(cardIdx int) error

DiscardCard 人間プレイヤーが手札から1枚をディスカードする

### func (*Pineapple) ExportProfile

func (p *Pineapple) ExportProfile() interface{}

ExportProfile メタAIプロファイルをエクスポートする

### func (*Pineapple) GetActedFlags

func (p *Pineapple) GetActedFlags() []bool

GetActedFlags actedフラグ取得

### func (*Pineapple) GetActionLog

func (p *Pineapple) GetActionLog() []*ActionLogEntry

GetActionLog 棋譜を取得する

### func (*Pineapple) GetAddonUsed

func (p *Pineapple) GetAddonUsed() []bool

GetAddonUsed プレイヤーごとのアドオン使用フラグ取得

### func (*Pineapple) GetCommunityCards

func (p *Pineapple) GetCommunityCards() []*Card

GetCommunityCards コミュニティカード取得

### func (*Pineapple) GetConfig

func (p *Pineapple) GetConfig() PineappleConfig

GetConfig 設定取得

### func (*Pineapple) GetCpuActions

func (p *Pineapple) GetCpuActions() []PineappleCpuAction

GetCpuActions CPU行動記録取得

### func (*Pineapple) GetCurrentTurn

func (p *Pineapple) GetCurrentTurn() int

GetCurrentTurn 現在のターン取得

### func (*Pineapple) GetDealerIdx

func (p *Pineapple) GetDealerIdx() int

GetDealerIdx ディーラーインデックス取得

### func (*Pineapple) GetDiscardDone

func (p *Pineapple) GetDiscardDone() []bool

GetDiscardDone ディスカード済みフラグ取得

### func (*Pineapple) GetEquity

func (p *Pineapple) GetEquity() *HoldemEquityResult

GetEquity エクイティ計算結果を返す

### func (*Pineapple) GetGameEndFlag

func (p *Pineapple) GetGameEndFlag() bool

GetGameEndFlag ゲーム終了フラグ取得

### func (*Pineapple) GetHandCount

func (p *Pineapple) GetHandCount() int

GetHandCount ハンド数取得

### func (*Pineapple) GetHumanProfile

func (p *Pineapple) GetHumanProfile() *BettingHumanProfile

GetHumanProfile メタAIプロファイル取得

### func (*Pineapple) GetLastBet

func (p *Pineapple) GetLastBet() int

GetLastBet 最後のベット取得

### func (*Pineapple) GetLastCpuError

func (p *Pineapple) GetLastCpuError() error

GetLastCpuError 最後のCPUアクションエラー取得

### func (*Pineapple) GetMinRaise

func (p *Pineapple) GetMinRaise() int

GetMinRaise 最小レイズ額取得

### func (*Pineapple) GetPhase

func (p *Pineapple) GetPhase() int

GetPhase フェーズ取得

### func (*Pineapple) GetPlayer

func (p *Pineapple) GetPlayer(i int) *PineapplePlayer

GetPlayer 指定プレイヤー取得

### func (*Pineapple) GetPlayerCnt

func (p *Pineapple) GetPlayerCnt() int

GetPlayerCnt プレイヤー数取得

### func (*Pineapple) GetPlayers

func (p *Pineapple) GetPlayers() []*PineapplePlayer

GetPlayers プレイヤー一覧取得

### func (*Pineapple) GetPot

func (p *Pineapple) GetPot() int

GetPot ポット取得

### func (*Pineapple) GetPotOdds

func (p *Pineapple) GetPotOdds() float64

GetPotOdds ポットオッズを返す

### func (*Pineapple) GetRaiseCount

func (p *Pineapple) GetRaiseCount() int

GetRaiseCount 現在のレイズ回数取得

### func (*Pineapple) GetRebuyCounts

func (p *Pineapple) GetRebuyCounts() []int

GetRebuyCounts プレイヤーごとのリバイ回数取得

### func (*Pineapple) GetRebuyPhaseType

func (p *Pineapple) GetRebuyPhaseType() int

GetRebuyPhaseType リバイフェーズ種別取得

### func (*Pineapple) GetRoundResults

func (p *Pineapple) GetRoundResults() []PineappleResult

GetRoundResults ラウンド結果取得

### func (*Pineapple) GetSidePots

func (p *Pineapple) GetSidePots() []PineappleSidePot

GetSidePots サイドポット取得

### func (*Pineapple) ImportProfile

func (p *Pineapple) ImportProfile(data []byte) error

ImportProfile JSONバイトからメタAIプロファイルをインポートする

### func (*Pineapple) IsAddonAvailable

func (p *Pineapple) IsAddonAvailable() bool

IsAddonAvailable 人間プレイヤーがアドオン可能かどうか

### func (*Pineapple) IsDiscardPhase

func (p *Pineapple) IsDiscardPhase() bool

IsDiscardPhase ディスカードフェーズかどうか

### func (*Pineapple) IsHumanTurn

func (p *Pineapple) IsHumanTurn() bool

IsHumanTurn 人間のターンかチェック

### func (*Pineapple) IsMuckAvailable

func (p *Pineapple) IsMuckAvailable() bool

IsMuckAvailable 人間プレイヤーがマック可能かどうか

### func (*Pineapple) IsRebuyAvailable

func (p *Pineapple) IsRebuyAvailable() bool

IsRebuyAvailable 人間プレイヤーがリバイ可能かどうか

### func (*Pineapple) MarshalJSON

func (p *Pineapple) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*Pineapple) Muck

func (p *Pineapple) Muck() error

Muck 人間プレイヤーがハンドをマックする

### func (*Pineapple) PlayerAction

func (p *Pineapple) PlayerAction(action, amount, humanPlayMs int) error

PlayerAction 人間プレイヤーのアクション実行 humanPlayMs: 迷い時間(ms, 0=計測なし)

### func (*Pineapple) Rebuy

func (p *Pineapple) Rebuy() error

Rebuy 人間プレイヤーがリバイを実行する

### func (*Pineapple) Reset

func (p *Pineapple) Reset() error

Reset ゲーム初期化

### func (*Pineapple) ResetProfile

func (p *Pineapple) ResetProfile()

ResetProfile メタAIプロファイルをリセットする

### func (*Pineapple) Resize

func (p *Pineapple) Resize(players []*PineapplePlayer)

Resize プレイヤースライスを差し替え、プレイヤー数依存スライスを再初期化する

### func (*Pineapple) SetConfig

func (p *Pineapple) SetConfig(cfg PineappleConfig)

SetConfig 設定変更

### func (*Pineapple) ShowHand

func (p *Pineapple) ShowHand() error

ShowHand 人間プレイヤーがハンドを公開する

### func (*Pineapple) SkipAddon

func (p *Pineapple) SkipAddon() error

SkipAddon 人間プレイヤーがアドオンを辞退する

### func (*Pineapple) SkipRebuy

func (p *Pineapple) SkipRebuy() error

SkipRebuy 人間プレイヤーがリバイを辞退する

### func (*Pineapple) UnmarshalJSON

func (p *Pineapple) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type PineappleConfig

PineappleConfig パイナップルポーカー設定 (HoldemConfigと同一構造)

type PineappleConfig = HoldemConfig

### func DefaultPineappleConfig

func DefaultPineappleConfig() PineappleConfig

DefaultPineappleConfig デフォルト設定

## type PineappleCpuAction

PineappleCpuAction CPU行動記録

type PineappleCpuAction = HoldemCpuAction

## type PineapplePlayStyle

PineapplePlayStyle CPUプレイスタイル (HoldemPlayStyleと同一)

type PineapplePlayStyle = HoldemPlayStyle

## type PineapplePlayer

PineapplePlayer パイナップルポーカープレイヤークラス

type PineapplePlayer struct {
    Player     // 親クラス
    ChipHolder // チップ管理
    // contains filtered or unexported fields
}

### func NewPineapplePlayer

func NewPineapplePlayer(isHuman bool, style HoldemPlayStyle) *PineapplePlayer

NewPineapplePlayer コンストラクタ

### func NewPineapplePlayersForTable

func NewPineapplePlayersForTable(tableSize int) []*PineapplePlayer

NewPineapplePlayersForTable 指定されたテーブルサイズに応じたパイナップルプレイヤースライスを生成する

### func (*PineapplePlayer) EvalBestHand

func (pp *PineapplePlayer) EvalBestHand(communityCards []*Card) int

EvalBestHand コミュニティカードとホールカードからベスト5枚を評価 ディスカード後は2枚のホールカード + コミュニティカードからC(N,5)で評価 (Holdemと同じ) ディスカード前は3枚のホールカード + コミュニティカードからC(N,5)で評価

### func (*PineapplePlayer) GetAFDisplay

func (pp *PineapplePlayer) GetAFDisplay() string

GetAFDisplay AF表示文字列取得 (“-”=アクションなし, “∞”=コールなし, “X.X”=通常)

### func (*PineapplePlayer) GetBestHand

func (pp *PineapplePlayer) GetBestHand() []*Card

GetBestHand ベストハンド取得

### func (*PineapplePlayer) GetComparisonCards

func (pp *PineapplePlayer) GetComparisonCards() []*Card

GetComparisonCards ハンド比較用カード取得 (BettingPlayerインターフェース)

### func (*PineapplePlayer) GetIsHuman

func (pp *PineapplePlayer) GetIsHuman() bool

GetIsHuman 人間フラグ取得

### func (*PineapplePlayer) GetPFR

func (pp *PineapplePlayer) GetPFR() int

GetPFR PFR%取得 (0 if totalHands==0)

### func (*PineapplePlayer) GetPFRCount

func (pp *PineapplePlayer) GetPFRCount() int

GetPFRCount PFR対象ハンド数取得

### func (*PineapplePlayer) GetPlayStyle

func (pp *PineapplePlayer) GetPlayStyle() HoldemPlayStyle

GetPlayStyle プレイスタイル取得

### func (*PineapplePlayer) GetPlayStyleName

func (pp *PineapplePlayer) GetPlayStyleName() string

GetPlayStyleName プレイスタイル名取得

### func (*PineapplePlayer) GetPostFlopBetRaise

func (pp *PineapplePlayer) GetPostFlopBetRaise() int

GetPostFlopBetRaise ポストフロップ ベット+レイズ回数取得

### func (*PineapplePlayer) GetPostFlopCall

func (pp *PineapplePlayer) GetPostFlopCall() int

GetPostFlopCall ポストフロップ コール回数取得

### func (*PineapplePlayer) GetThreeBet

func (pp *PineapplePlayer) GetThreeBet() int

GetThreeBet 3Bet%取得 (0 if threeBetOpportunity==0)

### func (*PineapplePlayer) GetThreeBetCount

func (pp *PineapplePlayer) GetThreeBetCount() int

GetThreeBetCount 3Bet実行数取得

### func (*PineapplePlayer) GetThreeBetOpportunity

func (pp *PineapplePlayer) GetThreeBetOpportunity() int

GetThreeBetOpportunity 3Bet機会数取得

### func (*PineapplePlayer) GetTotalHands

func (pp *PineapplePlayer) GetTotalHands() int

GetTotalHands 総ハンド数取得

### func (*PineapplePlayer) GetVPIP

func (pp *PineapplePlayer) GetVPIP() int

GetVPIP VPIP%取得 (0 if totalHands==0)

### func (*PineapplePlayer) GetVPIPCount

func (pp *PineapplePlayer) GetVPIPCount() int

GetVPIPCount VPIP対象ハンド数取得

### func (*PineapplePlayer) IncrementPFR

func (pp *PineapplePlayer) IncrementPFR()

IncrementPFR PFR対象ハンド数をインクリメント

### func (*PineapplePlayer) IncrementPostFlopBetRaise

func (pp *PineapplePlayer) IncrementPostFlopBetRaise()

IncrementPostFlopBetRaise ポストフロップ ベット+レイズ回数をインクリメント

### func (*PineapplePlayer) IncrementPostFlopCall

func (pp *PineapplePlayer) IncrementPostFlopCall()

IncrementPostFlopCall ポストフロップ コール回数をインクリメント

### func (*PineapplePlayer) IncrementThreeBet

func (pp *PineapplePlayer) IncrementThreeBet()

IncrementThreeBet 3Bet実行数をインクリメント

### func (*PineapplePlayer) IncrementThreeBetOpportunity

func (pp *PineapplePlayer) IncrementThreeBetOpportunity()

IncrementThreeBetOpportunity 3Bet機会数をインクリメント

### func (*PineapplePlayer) IncrementTotalHands

func (pp *PineapplePlayer) IncrementTotalHands()

IncrementTotalHands 総ハンド数をインクリメント

### func (*PineapplePlayer) IncrementVPIP

func (pp *PineapplePlayer) IncrementVPIP()

IncrementVPIP VPIP対象ハンド数をインクリメント

### func (*PineapplePlayer) MarshalJSON

func (pp *PineapplePlayer) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*PineapplePlayer) UnmarshalJSON

func (pp *PineapplePlayer) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type PineappleResult

PineappleResult ショーダウン結果

type PineappleResult = HoldemResult

## type PineappleSidePot

PineappleSidePot サイドポット (共通SidePot型のエイリアス)

type PineappleSidePot = SidePot

## type Pinochle

Pinochle ピノクルゲームクラス

type Pinochle struct {
    // contains filtered or unexported fields
}

### func NewPinochle

func NewPinochle(trumpCards *TrumpCards, players []*PinochlePlayer, config PinochleConfig) *Pinochle

NewPinochle コンストラクタ

### func (*Pinochle) ConfirmMelds

func (p *Pinochle) ConfirmMelds()

ConfirmMelds メルドを確認してプレイフェーズに進む

### func (*Pinochle) CpuBid

func (p *Pinochle) CpuBid()

CpuBid CPUがビッドまたはパスする

### func (*Pinochle) CpuCallTrump

func (p *Pinochle) CpuCallTrump()

CpuCallTrump CPUがトランプを宣言する

### func (*Pinochle) CpuPlay

func (p *Pinochle) CpuPlay()

CpuPlay CPUがカードをプレイする

### func (*Pinochle) GetActionLog

func (p *Pinochle) GetActionLog() []*ActionLogEntry

GetActionLog アクションログを取得

### func (*Pinochle) GetBidPlayerIdx

func (p *Pinochle) GetBidPlayerIdx() int

GetBidPlayerIdx ビッド手番インデックスを取得

### func (*Pinochle) GetConfig

func (p *Pinochle) GetConfig() PinochleConfig

GetConfig 設定を取得

### func (*Pinochle) GetCurrentPlayerIdx

func (p *Pinochle) GetCurrentPlayerIdx() int

GetCurrentPlayerIdx 現在のプレイヤーインデックスを取得

### func (*Pinochle) GetCurrentTrick

func (p *Pinochle) GetCurrentTrick() []*PinochleTrickCard

GetCurrentTrick 現在のトリックを取得

### func (*Pinochle) GetDealerIdx

func (p *Pinochle) GetDealerIdx() int

GetDealerIdx ディーラーインデックスを取得

### func (*Pinochle) GetGameEndFlag

func (p *Pinochle) GetGameEndFlag() bool

GetGameEndFlag ゲーム終了フラグを取得

### func (*Pinochle) GetHighestBid

func (p *Pinochle) GetHighestBid() int

GetHighestBid 最高ビッド額を取得

### func (*Pinochle) GetHighestBidder

func (p *Pinochle) GetHighestBidder() int

GetHighestBidder 最高ビッダーインデックスを取得

### func (*Pinochle) GetHint

func (p *Pinochle) GetHint() *PinochleHint

GetHint ヒントを取得する

### func (*Pinochle) GetLeadPlayerIdx

func (p *Pinochle) GetLeadPlayerIdx() int

GetLeadPlayerIdx リードプレイヤーインデックスを取得

### func (*Pinochle) GetPhase

func (p *Pinochle) GetPhase() PinochlePhase

GetPhase フェーズを取得

### func (*Pinochle) GetPlayer

func (p *Pinochle) GetPlayer(i int) *PinochlePlayer

GetPlayer 指定インデックスのプレイヤーを取得する

### func (*Pinochle) GetPlayerCnt

func (p *Pinochle) GetPlayerCnt() int

GetPlayerCnt プレイヤー数を取得する

### func (*Pinochle) GetPlayerMelds

func (p *Pinochle) GetPlayerMelds() [PinochlePlayerCnt][]*PinochleMeld

GetPlayerMelds プレイヤーのメルドを取得

### func (*Pinochle) GetPlayers

func (p *Pinochle) GetPlayers() []*PinochlePlayer

GetPlayers プレイヤーを取得

### func (*Pinochle) GetRoundNumber

func (p *Pinochle) GetRoundNumber() int

GetRoundNumber ラウンド番号を取得

### func (*Pinochle) GetTeamScore

func (p *Pinochle) GetTeamScore(team int) int

GetTeamScore チームスコアを取得する

### func (*Pinochle) GetTeamScores

func (p *Pinochle) GetTeamScores() [PinochleTeamCnt]int

GetTeamScores チームスコアを取得

### func (*Pinochle) GetTrickNumber

func (p *Pinochle) GetTrickNumber() int

GetTrickNumber トリック番号を取得

### func (*Pinochle) GetTrumpSuit

func (p *Pinochle) GetTrumpSuit() int

GetTrumpSuit 切り札スートを取得

### func (*Pinochle) GetValidPlayIndices

func (p *Pinochle) GetValidPlayIndices(playerIdx int) []int

GetValidPlayIndices プレイ可能なカードのインデックスを返す (外部公開用)

### func (*Pinochle) GetWinnerTeam

func (p *Pinochle) GetWinnerTeam() int

GetWinnerTeam 勝利チームを取得

### func (*Pinochle) Hint

func (p *Pinochle) Hint() *PinochleHint

Hint ヒントを返す

### func (*Pinochle) IsHumanBidTurn

func (p *Pinochle) IsHumanBidTurn() bool

IsHumanBidTurn 現在のビッド手番が人間かを返す

### func (*Pinochle) IsHumanTurn

func (p *Pinochle) IsHumanTurn() bool

IsHumanTurn 現在の手番が人間かを返す

### func (*Pinochle) MarshalJSON

func (p *Pinochle) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*Pinochle) NextRound

func (p *Pinochle) NextRound()

NextRound 次のラウンドを開始する

### func (*Pinochle) NextTrick

func (p *Pinochle) NextTrick()

NextTrick 次のトリックを開始する 注: ResolveTrick() は呼び出し元 (Interactor) が先に実行する。

### func (*Pinochle) PlayerBid

func (p *Pinochle) PlayerBid(amount int) error

PlayerBid 人間プレイヤーがビッドする

### func (*Pinochle) PlayerCallTrump

func (p *Pinochle) PlayerCallTrump(suit int) error

PlayerCallTrump 人間プレイヤーがトランプスートを宣言する

### func (*Pinochle) PlayerPass

func (p *Pinochle) PlayerPass() error

PlayerPass 人間プレイヤーがパスする

### func (*Pinochle) PlayerPlay

func (p *Pinochle) PlayerPlay(cardIndex int) error

PlayerPlay 人間プレイヤーがカードをプレイする

### func (*Pinochle) Reset

func (p *Pinochle) Reset()

Reset ゲーム初期化

### func (*Pinochle) ResolveTrick

func (p *Pinochle) ResolveTrick()

ResolveTrick トリックを解決する

### func (*Pinochle) SetConfig

func (p *Pinochle) SetConfig(config PinochleConfig)

SetConfig 設定を変更

### func (*Pinochle) SortHand

func (p *Pinochle) SortHand(playerIdx int)

SortHand 手札をソートする (スート順 → ランク順) ReorderCards を使用してインプレースで並び替えることで Reset+AddCard の副作用を回避する

### func (*Pinochle) UnmarshalJSON

func (p *Pinochle) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type PinochleConfig

PinochleConfig ピノクルゲーム設定

type PinochleConfig struct {
    CpuDifficulty PinochleCpuDifficulty `json:"cd"`
    PointLimit    int                   `json:"pl"` // ゲーム終了スコア (先に到達したチームが勝利, デフォルト1500)
}

### func DefaultPinochleConfig

func DefaultPinochleConfig() PinochleConfig

DefaultPinochleConfig デフォルト設定を返す

### func (PinochleConfig) Validate

func (c PinochleConfig) Validate() error

Validate 設定値のドメインバリデーション

## type PinochleCpuDifficulty

PinochleCpuDifficulty CPU の難易度レベル

type PinochleCpuDifficulty int

ピノクルのCPU難易度定数

const (
    // PinochleCpuDifficultyEasy 低難易度
    PinochleCpuDifficultyEasy PinochleCpuDifficulty = iota
    // PinochleCpuDifficultyNormal 中難易度
    PinochleCpuDifficultyNormal
    // PinochleCpuDifficultyHard 高難易度
    PinochleCpuDifficultyHard
)

## type PinochleHint

PinochleHint ヒント情報

type PinochleHint struct {
    CardIndex *int   // 推奨カードインデックス (プレイ時)
    BidAmount *int   // 推奨ビッド額 (ビッド時)
    Pass      *bool  // パスすべきか
    Suit      *int   // 推奨スート (トランプ宣言時)
    Reason    string // ヒント理由キー
}

## type PinochleMeld

PinochleMeld 検出されたメルド

type PinochleMeld struct {
    Type   PinochleMeldType `json:"t"`
    Points int              `json:"p"`
    Cards  []*Card          `json:"c"`
}

## type PinochleMeldType

PinochleMeldType メルドの種類

type PinochleMeldType int

メルド種類定数

const (
    PinochleMeldDix                PinochleMeldType = iota // 9 of trump (10)
    PinochleMeldCommonMarriage                             // K-Q of non-trump (20)
    PinochleMeldRoyalMarriage                              // K-Q of trump (40)
    PinochleMeldPinochle                                   // J♦ + Q♠ (40)
    PinochleMeldJacksAround                                // One J of each suit (40)
    PinochleMeldQueensAround                               // One Q of each suit (60)
    PinochleMeldKingsAround                                // One K of each suit (80)
    PinochleMeldAcesAround                                 // One A of each suit (100)
    PinochleMeldRun                                        // A-10-K-Q-J of trump (150)
    PinochleMeldDoublePinochle                             // 2x J♦ + 2x Q♠ (300)
    PinochleMeldDoubleJacksAround                          // 2x J of each suit (400)
    PinochleMeldDoubleQueensAround                         // 2x Q of each suit (600)
    PinochleMeldDoubleKingsAround                          // 2x K of each suit (800)
    PinochleMeldDoubleAcesAround                           // 2x A of each suit (1000)
    PinochleMeldDoubleRun                                  // 2x A-10-K-Q-J of trump (1500)
)

## type PinochlePhase

PinochlePhase ゲームフェーズ

type PinochlePhase int

ピノクルのフェーズ定数

const (
    // PinochlePhaseBid ビッドフェーズ
    PinochlePhaseBid PinochlePhase = 0
    // PinochlePhaseTrump トランプ宣言フェーズ
    PinochlePhaseTrump PinochlePhase = 1
    // PinochlePhaseMeld メルドフェーズ
    PinochlePhaseMeld PinochlePhase = 2
    // PinochlePhasePlay トリックプレイフェーズ
    PinochlePhasePlay PinochlePhase = 3
    // PinochlePhaseTrickEnd トリック終了フェーズ
    PinochlePhaseTrickEnd PinochlePhase = 4
    // PinochlePhaseRoundEnd ラウンド終了フェーズ
    PinochlePhaseRoundEnd PinochlePhase = 5
    // PinochlePhaseGameEnd ゲーム終了フェーズ
    PinochlePhaseGameEnd PinochlePhase = 6
)

## type PinochlePlayer

PinochlePlayer ピノクルプレイヤークラス

type PinochlePlayer struct {
    *GamePlayer
    TrickHolder
    // contains filtered or unexported fields
}

### func NewPinochlePlayer

func NewPinochlePlayer(isHuman bool, team int) *PinochlePlayer

NewPinochlePlayer コンストラクタ

### func (*PinochlePlayer) AddTrickPoints

func (p *PinochlePlayer) AddTrickPoints(pts int)

AddTrickPoints トリックポイントを加算

### func (*PinochlePlayer) GetBid

func (p *PinochlePlayer) GetBid() int

GetBid ビッド額を取得

### func (*PinochlePlayer) GetHasPassed

func (p *PinochlePlayer) GetHasPassed() bool

GetHasPassed パス済みかどうかを取得

### func (*PinochlePlayer) GetMeldScore

func (p *PinochlePlayer) GetMeldScore() int

GetMeldScore メルド得点を取得

### func (*PinochlePlayer) GetTeam

func (p *PinochlePlayer) GetTeam() int

GetTeam チームインデックスを取得

### func (*PinochlePlayer) GetTrickPoints

func (p *PinochlePlayer) GetTrickPoints() int

GetTrickPoints トリックポイントを取得

### func (*PinochlePlayer) MarshalJSON

func (p *PinochlePlayer) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*PinochlePlayer) ResetRound

func (p *PinochlePlayer) ResetRound()

ResetRound ラウンドをリセット(トリック・手札・終了状態を初期化)

### func (*PinochlePlayer) SetBid

func (p *PinochlePlayer) SetBid(bid int)

SetBid ビッド額を設定

### func (*PinochlePlayer) SetHasPassed

func (p *PinochlePlayer) SetHasPassed(v bool)

SetHasPassed パス済み状態を設定

### func (*PinochlePlayer) SetMeldScore

func (p *PinochlePlayer) SetMeldScore(score int)

SetMeldScore メルド得点を設定

### func (*PinochlePlayer) SetTrickPoints

func (p *PinochlePlayer) SetTrickPoints(pts int)

SetTrickPoints トリックポイントを設定

### func (*PinochlePlayer) UnmarshalJSON

func (p *PinochlePlayer) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type PinochleTrickCard

PinochleTrickCard トリック中の1枚

type PinochleTrickCard struct {
    PlayerIdx int   `json:"pi"`
    Card      *Card `json:"c"`
}

## type Player

Player プレイヤークラス

type Player struct {
    // contains filtered or unexported fields
}

### func (*Player) AddCard

func (p *Player) AddCard(card *Card)

AddCard カード追加

### func (*Player) GetCard

func (p *Player) GetCard(idx int) *Card

GetCard 指定番目のカード取得

### func (*Player) GetCardsSize

func (p *Player) GetCardsSize() int

GetCardsSize プレイヤーカードの枚数取得

### func (*Player) InsertCard

func (p *Player) InsertCard(card *Card, pos int)

InsertCard 指定位置にカードを挿入する。位置が範囲外の場合は末尾に追加。

### func (*Player) MarshalJSON

func (p *Player) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*Player) PrependCard

func (p *Player) PrependCard(card *Card)

PrependCard カードを手札の先頭に追加

### func (*Player) RemoveCard

func (p *Player) RemoveCard(idx int) *Card

RemoveCard 指定インデックスのカードを手札から取り除いて返す。 範囲外なら nil を返す。

### func (*Player) RemoveCards

func (p *Player) RemoveCards(indices []int) []*Card

RemoveCards 複数インデックスのカードを手札から取り除いて返す。 重複インデックスは自動排除、範囲外は無視。返却順はインデックス昇順。

### func (*Player) ReorderCards

func (p *Player) ReorderCards(indices []int) error

ReorderCards indices で指定された順番に手札を並び替える。 indices は [0, len(cards)) の有効な順列でなければならない。

### func (*Player) Reset

func (p *Player) Reset()

Reset カードリセット

### func (*Player) ShuffleCards

func (p *Player) ShuffleCards()

ShuffleCards 手札をランダムに並び替える。 Go 1.20 以降はグローバル乱数生成器が起動時に自動でランダムシードされるため、 追加のシード設定は不要。

### func (*Player) UnmarshalJSON

func (p *Player) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type Poker

Poker ポーカークラス (5枚ドローポーカー・マルチプレイヤー)

type Poker struct {
    // contains filtered or unexported fields
}

### func NewPoker

func NewPoker(trumpCards *TrumpCards, players []*PokerPlayer, config PokerConfig) *Poker

NewPoker コンストラクタ

### func (*Poker) CalcDrawOdds

func (p *Poker) CalcDrawOdds(indices []int) ([]PokerDrawOdds, error)

CalcDrawOdds 交換候補のカードインデックスに基づくドローオッズを計算する indices: 交換するカードのインデックス (0-4)

### func (*Poker) ExportProfile

func (p *Poker) ExportProfile() interface{}

ExportProfile メタAIプロファイルをエクスポートする (プロファイルがない場合はnil)

### func (*Poker) GetActionLog

func (p *Poker) GetActionLog() []*ActionLogEntry

GetActionLog 棋譜を取得する

### func (*Poker) GetAnte

func (p *Poker) GetAnte() int

GetAnte アンティ取得

### func (*Poker) GetConfig

func (p *Poker) GetConfig() PokerConfig

GetConfig 設定取得

### func (*Poker) GetCpuActions

func (p *Poker) GetCpuActions() []PokerCpuAction

GetCpuActions CPU行動記録取得

### func (*Poker) GetCpuExchanges

func (p *Poker) GetCpuExchanges() []PokerCpuExchange

GetCpuExchanges CPU交換記録取得

### func (*Poker) GetCurrentTurn

func (p *Poker) GetCurrentTurn() int

GetCurrentTurn 現在のターン取得

### func (*Poker) GetDealerIdx

func (p *Poker) GetDealerIdx() int

GetDealerIdx ディーラーインデックス取得

### func (*Poker) GetGameEndFlag

func (p *Poker) GetGameEndFlag() bool

GetGameEndFlag ゲーム終了フラグ取得

### func (*Poker) GetHumanProfile

func (p *Poker) GetHumanProfile() *BettingHumanProfile

GetHumanProfile メタAIプロファイル取得

### func (*Poker) GetLastBet

func (p *Poker) GetLastBet() int

GetLastBet 最後のベット取得

### func (*Poker) GetLastCpuError

func (p *Poker) GetLastCpuError() error

GetLastCpuError 最後のCPUアクションエラー取得 (テスト・デバッグ用)

### func (*Poker) GetMinRaise

func (p *Poker) GetMinRaise() int

GetMinRaise 最小レイズ額取得

### func (*Poker) GetPhase

func (p *Poker) GetPhase() int

GetPhase フェーズ取得

### func (*Poker) GetPlayers

func (p *Poker) GetPlayers() []*PokerPlayer

GetPlayers プレイヤー一覧取得

### func (*Poker) GetPot

func (p *Poker) GetPot() int

GetPot ポット取得

### func (*Poker) GetRaiseCount

func (p *Poker) GetRaiseCount() int

GetRaiseCount 現在のレイズ回数取得

### func (*Poker) GetRoundResults

func (p *Poker) GetRoundResults() []PokerResult

GetRoundResults ラウンド結果取得

### func (*Poker) GetSidePots

func (p *Poker) GetSidePots() []PokerSidePot

GetSidePots サイドポット取得

### func (*Poker) ImportProfile

func (p *Poker) ImportProfile(data []byte) error

ImportProfile JSONバイトからメタAIプロファイルをインポートする

### func (*Poker) MarshalJSON

func (p *Poker) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*Poker) PlayerAction

func (p *Poker) PlayerAction(action, amount, humanPlayMs int) error

PlayerAction 人間プレイヤーのアクション実行 humanPlayMs: 迷い時間(ms, 0=計測なし)

### func (*Poker) PlayerExchange

func (p *Poker) PlayerExchange(indices []int) error

PlayerExchange プレイヤーカード交換

### func (*Poker) PlayerStand

func (p *Poker) PlayerStand() error

PlayerStand カード交換なし

### func (*Poker) Reset

func (p *Poker) Reset() error

Reset ゲーム初期化

### func (*Poker) ResetProfile

func (p *Poker) ResetProfile()

ResetProfile メタAIプロファイルをリセットする

### func (*Poker) SetConfig

func (p *Poker) SetConfig(cfg PokerConfig)

SetConfig 設定変更

### func (*Poker) UnmarshalJSON

func (p *Poker) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type PokerConfig

PokerConfig ポーカー設定

type PokerConfig struct {
    InitChips    int              // 初期チップ
    Ante         int              // アンティ
    MinBet       int              // 最小ベット
    CpuCount     int              // CPU数 (1-3)
    JokerCount   int              // ジョーカー枚数 (0-2)
    BettingLimit BettingLimitType // ベッティングリミット
    IsLowball    bool             // 2-7 Lowball モード
    CpuMetaAI    bool             // メタAI: セッション内学習
}

### func DefaultPokerConfig

func DefaultPokerConfig() PokerConfig

DefaultPokerConfig デフォルト設定

### func (PokerConfig) Validate

func (c PokerConfig) Validate() error

Validate 設定値のドメインバリデーション

## type PokerCpuAction

PokerCpuAction CPU行動記録

type PokerCpuAction struct {
    PlayerIdx int // プレイヤーインデックス
    Action    int // アクション
    Amount    int // 金額
}

## type PokerCpuExchange

PokerCpuExchange CPUカード交換記録

type PokerCpuExchange struct {
    PlayerIdx     int // プレイヤーインデックス
    ExchangeCount int // 交換枚数
}

## type PokerDrawOdds

PokerDrawOdds ドローオッズ (各ハンドランクの確率)

type PokerDrawOdds struct {
    HandRank    int     // ハンドランク
    HandName    string  // ハンド名
    Probability float64 // 確率 (0.0 - 1.0)
    Count       int     // 該当する組み合わせ数
    Total       int     // 全組み合わせ数
}

## type PokerPlayStyle

PokerPlayStyle CPUプレイスタイル

type PokerPlayStyle int

Pokerのプレイスタイル定数

const (
    PokerStyleConservative PokerPlayStyle = iota // 保守的
    PokerStyleBalanced                           // バランス
    PokerStyleAggressive                         // 攻撃的
    PokerStyleBluffer                            // ブラフ重視
)

## type PokerPlayer

PokerPlayer ポーカープレイヤークラス

type PokerPlayer struct {
    Player     // 親クラス
    ChipHolder // チップ管理
    // contains filtered or unexported fields
}

### func NewPokerPlayer

func NewPokerPlayer(isHuman bool, style PokerPlayStyle) *PokerPlayer

NewPokerPlayer コンストラクタ

### func (*PokerPlayer) EvalHand

func (pp *PokerPlayer) EvalHand() int

EvalHand ハンド評価

### func (*PokerPlayer) ExchangeCard

func (pp *PokerPlayer) ExchangeCard(idx int, card *Card)

ExchangeCard 指定インデックスのカードを交換

### func (*PokerPlayer) GetComparisonCards

func (pp *PokerPlayer) GetComparisonCards() []*Card

GetComparisonCards ハンド比較用カード取得 (BettingPlayerインターフェース)

### func (*PokerPlayer) GetExchangeCount

func (pp *PokerPlayer) GetExchangeCount() int

GetExchangeCount 交換枚数取得

### func (*PokerPlayer) GetHandName

func (pp *PokerPlayer) GetHandName() string

GetHandName ハンド名取得

### func (*PokerPlayer) GetIsHuman

func (pp *PokerPlayer) GetIsHuman() bool

GetIsHuman 人間フラグ取得

### func (*PokerPlayer) GetPlayStyle

func (pp *PokerPlayer) GetPlayStyle() PokerPlayStyle

GetPlayStyle プレイスタイル取得

### func (*PokerPlayer) GetPlayStyleName

func (pp *PokerPlayer) GetPlayStyleName() string

GetPlayStyleName プレイスタイル名取得

### func (*PokerPlayer) MarshalJSON

func (pp *PokerPlayer) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*PokerPlayer) SetExchangeCount

func (pp *PokerPlayer) SetExchangeCount(count int)

SetExchangeCount 交換枚数設定

### func (*PokerPlayer) UnmarshalJSON

func (pp *PokerPlayer) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type PokerResult

PokerResult ショーダウン結果

type PokerResult struct {
    PlayerIdx int    // プレイヤーインデックス
    HandRank  int    // ハンドランク
    HandName  string // ハンド名
    Kickers   []int  // キッカーカード値
    WonAmount int    // 獲得チップ
}

## type PokerSidePot

PokerSidePot サイドポット (共通SidePot型のエイリアス)

type PokerSidePot = SidePot

## type Pyramid

Pyramid ピラミッドソリティアゲームクラス

type Pyramid struct {
    // contains filtered or unexported fields
}

### func NewPyramid

func NewPyramid(trumpCards *TrumpCards) *Pyramid

NewPyramid コンストラクタ

### func (*Pyramid) AllRemoved

func (p *Pyramid) AllRemoved() bool

AllRemoved 全ピラミッドカードが除去されたか

### func (*Pyramid) CanUndo

func (p *Pyramid) CanUndo() bool

CanUndo アンドゥ可能かどうか

### func (*Pyramid) Draw

func (p *Pyramid) Draw() error

Draw ストックからウェイストにカードを引く

### func (*Pyramid) GetActionLog

func (p *Pyramid) GetActionLog() []*ActionLogEntry

GetActionLog 棋譜取得

### func (*Pyramid) GetHint

func (p *Pyramid) GetHint() *PyramidHint

GetHint ヒントを取得

### func (*Pyramid) GetMoveCount

func (p *Pyramid) GetMoveCount() int

GetMoveCount 移動回数取得

### func (*Pyramid) GetPhase

func (p *Pyramid) GetPhase() PyramidPhase

GetPhase フェーズ取得

### func (*Pyramid) GetPyramid

func (p *Pyramid) GetPyramid() [PyramidRowCnt][]*PyramidCard

GetPyramid ピラミッド取得

### func (*Pyramid) GetStockCount

func (p *Pyramid) GetStockCount() int

GetStockCount ストック枚数取得

### func (*Pyramid) GetWaste

func (p *Pyramid) GetWaste() []*Card

GetWaste ウェイスト取得

### func (*Pyramid) GiveUp

func (p *Pyramid) GiveUp()

GiveUp ギブアップ

### func (*Pyramid) IsExposed

func (p *Pyramid) IsExposed(row, col int) bool

IsExposed カードが露出しているか (テスト用の公開版)

### func (*Pyramid) IsStalemate

func (p *Pyramid) IsStalemate() bool

IsStalemate 手詰まり状態取得

### func (*Pyramid) MarshalJSON

func (p *Pyramid) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*Pyramid) RemoveKing

func (p *Pyramid) RemoveKing(row, col int) error

RemoveKing ピラミッド上のKを単独で除去

### func (*Pyramid) RemovePair

func (p *Pyramid) RemovePair(row1, col1, row2, col2 int) error

RemovePair ピラミッド上の2枚のカードを合計13で除去

### func (*Pyramid) RemoveWasteKing

func (p *Pyramid) RemoveWasteKing() error

RemoveWasteKing ウェイストのトップのKを単独で除去

### func (*Pyramid) RemoveWithWaste

func (p *Pyramid) RemoveWithWaste(row, col int) error

RemoveWithWaste ウェイストのトップカードとピラミッドのカードをペアで除去

### func (*Pyramid) Reset

func (p *Pyramid) Reset()

Reset ゲームリセット

### func (*Pyramid) SetIsStalemate

func (p *Pyramid) SetIsStalemate(v bool)

SetIsStalemate 手詰まり状態設定 (テスト用)

### func (*Pyramid) SetPhase

func (p *Pyramid) SetPhase(phase PyramidPhase)

SetPhase フェーズ設定 (テスト用)

### func (*Pyramid) SetPyramid

func (p *Pyramid) SetPyramid(pyramid [PyramidRowCnt][]*PyramidCard)

SetPyramid ピラミッド設定 (テスト用)

### func (*Pyramid) SetStock

func (p *Pyramid) SetStock(stock []*Card)

SetStock ストック設定 (テスト用)

### func (*Pyramid) SetWaste

func (p *Pyramid) SetWaste(waste []*Card)

SetWaste ウェイスト設定 (テスト用)

### func (*Pyramid) Undo

func (p *Pyramid) Undo() error

Undo 直前の操作を取り消す

### func (*Pyramid) UndoN

func (p *Pyramid) UndoN(n int) error

UndoN n回連続でアンドゥを実行する。

### func (*Pyramid) UndoToEscape

func (p *Pyramid) UndoToEscape() int

UndoToEscape 膠着状態から抜けるために必要なアンドゥ回数を返す。膠着状態でなければ0、脱出不可なら-1。

### func (*Pyramid) UnmarshalJSON

func (p *Pyramid) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type PyramidCard

PyramidCard ピラミッド上のカード

type PyramidCard struct {
    Card    *Card `json:"c"`
    Removed bool  `json:"r"`
}

## type PyramidHint

PyramidHint ヒント

type PyramidHint struct {
    Type string // "pair", "king", "waste_pair", "waste_king"
    Row1 int
    Col1 int
    Row2 int // -1 for king/waste operations
    Col2 int // -1 for king/waste operations
}

## type PyramidPhase

PyramidPhase ピラミッドゲームフェーズ

type PyramidPhase int

Pyramidのフェーズ定数

const (
    // PyramidPhasePlaying プレイ中
    PyramidPhasePlaying PyramidPhase = iota
    // PyramidPhaseGameClear ゲームクリア
    PyramidPhaseGameClear
    // PyramidPhaseGameOver ゲームオーバー
    PyramidPhaseGameOver
)

## type RankedGamePlayer

RankedGamePlayer ランク付きプレイヤー共通構造体

type RankedGamePlayer struct {
    *GamePlayer
    // contains filtered or unexported fields
}

### func NewRankedGamePlayer

func NewRankedGamePlayer(isHuman bool) *RankedGamePlayer

NewRankedGamePlayer コンストラクタ (rank defaults to -1)

### func (*RankedGamePlayer) GetRank

func (rp *RankedGamePlayer) GetRank() int

GetRank ランク取得 (-1 = 未確定)

### func (*RankedGamePlayer) MarshalJSON

func (rp *RankedGamePlayer) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*RankedGamePlayer) SetRank

func (rp *RankedGamePlayer) SetRank(r int)

SetRank ランク設定

### func (*RankedGamePlayer) UnmarshalJSON

func (rp *RankedGamePlayer) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type RoundScoreHolder

RoundScoreHolder ラウンドスコア管理の共通構造体

type RoundScoreHolder struct {
    // contains filtered or unexported fields
}

### func (*RoundScoreHolder) CommitRoundScore

func (h *RoundScoreHolder) CommitRoundScore()

CommitRoundScore ラウンドスコアを累積スコアに加算

### func (*RoundScoreHolder) GetCumulativeScore

func (h *RoundScoreHolder) GetCumulativeScore() int

GetCumulativeScore 累積スコアを取得

### func (*RoundScoreHolder) GetRoundScore

func (h *RoundScoreHolder) GetRoundScore() int

GetRoundScore 現在のラウンドスコアを取得

### func (*RoundScoreHolder) MarshalJSON

func (h *RoundScoreHolder) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*RoundScoreHolder) SetCumulativeScore

func (h *RoundScoreHolder) SetCumulativeScore(score int)

SetCumulativeScore 累積スコアを設定

### func (*RoundScoreHolder) SetRoundScore

func (h *RoundScoreHolder) SetRoundScore(score int)

SetRoundScore 現在のラウンドスコアを設定

### func (*RoundScoreHolder) UnmarshalJSON

func (h *RoundScoreHolder) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type SevenCardStud

SevenCardStud セブンカードスタッド

type SevenCardStud struct {
    // contains filtered or unexported fields
}

### func NewSevenCardStud

func NewSevenCardStud(trumpCards *TrumpCards, players []*SevenCardStudPlayer, config SevenCardStudConfig) *SevenCardStud

NewSevenCardStud コンストラクタ

### func (*SevenCardStud) Addon

func (s *SevenCardStud) Addon() error

Addon 人間プレイヤーがアドオンを実行する

### func (*SevenCardStud) ExportProfile

func (s *SevenCardStud) ExportProfile() interface{}

ExportProfile メタAIプロファイルをエクスポートする

### func (*SevenCardStud) GetActedFlags

func (s *SevenCardStud) GetActedFlags() []bool

GetActedFlags actedフラグ取得

### func (*SevenCardStud) GetActionLog

func (s *SevenCardStud) GetActionLog() []*ActionLogEntry

GetActionLog 棋譜を取得する

### func (*SevenCardStud) GetAddonUsed

func (s *SevenCardStud) GetAddonUsed() []bool

GetAddonUsed プレイヤーごとのアドオン使用フラグ取得

### func (*SevenCardStud) GetBringInPlayerIdx

func (s *SevenCardStud) GetBringInPlayerIdx() int

GetBringInPlayerIdx ブリングインプレイヤーインデックス取得

### func (*SevenCardStud) GetCommunityCard

func (s *SevenCardStud) GetCommunityCard() *Card

GetCommunityCard 共有カード取得 (カード不足時のみ)

### func (*SevenCardStud) GetConfig

func (s *SevenCardStud) GetConfig() SevenCardStudConfig

GetConfig 設定取得

### func (*SevenCardStud) GetCpuActions

func (s *SevenCardStud) GetCpuActions() []SevenCardStudCpuAction

GetCpuActions CPU行動記録取得

### func (*SevenCardStud) GetCurrentTurn

func (s *SevenCardStud) GetCurrentTurn() int

GetCurrentTurn 現在のターン取得

### func (*SevenCardStud) GetDealerIdx

func (s *SevenCardStud) GetDealerIdx() int

GetDealerIdx ディーラーインデックス取得

### func (*SevenCardStud) GetGameEndFlag

func (s *SevenCardStud) GetGameEndFlag() bool

GetGameEndFlag ゲーム終了フラグ取得

### func (*SevenCardStud) GetHandCount

func (s *SevenCardStud) GetHandCount() int

GetHandCount ハンド数取得

### func (*SevenCardStud) GetHumanProfile

func (s *SevenCardStud) GetHumanProfile() *BettingHumanProfile

GetHumanProfile メタAIプロファイル取得

### func (*SevenCardStud) GetLastBet

func (s *SevenCardStud) GetLastBet() int

GetLastBet 最後のベット取得

### func (*SevenCardStud) GetLastCpuError

func (s *SevenCardStud) GetLastCpuError() error

GetLastCpuError 最後のCPUアクションエラー取得

### func (*SevenCardStud) GetMinRaise

func (s *SevenCardStud) GetMinRaise() int

GetMinRaise 最小レイズ額取得

### func (*SevenCardStud) GetPhase

func (s *SevenCardStud) GetPhase() int

GetPhase フェーズ取得

### func (*SevenCardStud) GetPlayer

func (s *SevenCardStud) GetPlayer(i int) *SevenCardStudPlayer

GetPlayer 指定プレイヤー取得

### func (*SevenCardStud) GetPlayerCnt

func (s *SevenCardStud) GetPlayerCnt() int

GetPlayerCnt プレイヤー数取得

### func (*SevenCardStud) GetPlayers

func (s *SevenCardStud) GetPlayers() []*SevenCardStudPlayer

GetPlayers プレイヤー一覧取得

### func (*SevenCardStud) GetPot

func (s *SevenCardStud) GetPot() int

GetPot ポット取得

### func (*SevenCardStud) GetRaiseCount

func (s *SevenCardStud) GetRaiseCount() int

GetRaiseCount 現在のレイズ回数取得

### func (*SevenCardStud) GetRebuyCounts

func (s *SevenCardStud) GetRebuyCounts() []int

GetRebuyCounts プレイヤーごとのリバイ回数取得

### func (*SevenCardStud) GetRebuyPhaseType

func (s *SevenCardStud) GetRebuyPhaseType() int

GetRebuyPhaseType リバイフェーズ種別取得

### func (*SevenCardStud) GetRoundResults

func (s *SevenCardStud) GetRoundResults() []SevenCardStudResult

GetRoundResults ラウンド結果取得

### func (*SevenCardStud) GetSidePots

func (s *SevenCardStud) GetSidePots() []SevenCardStudSidePot

GetSidePots サイドポット取得

### func (*SevenCardStud) ImportProfile

func (s *SevenCardStud) ImportProfile(data []byte) error

ImportProfile JSONバイトからメタAIプロファイルをインポートする

### func (*SevenCardStud) IsAddonAvailable

func (s *SevenCardStud) IsAddonAvailable() bool

IsAddonAvailable 人間プレイヤーがアドオン可能かどうか

### func (*SevenCardStud) IsHumanTurn

func (s *SevenCardStud) IsHumanTurn() bool

IsHumanTurn 人間のターンかチェック

### func (*SevenCardStud) IsMuckAvailable

func (s *SevenCardStud) IsMuckAvailable() bool

IsMuckAvailable 人間プレイヤーがマック可能かどうか

### func (*SevenCardStud) IsRebuyAvailable

func (s *SevenCardStud) IsRebuyAvailable() bool

IsRebuyAvailable 人間プレイヤーがリバイ可能かどうか

### func (*SevenCardStud) MarshalJSON

func (s *SevenCardStud) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*SevenCardStud) Muck

func (s *SevenCardStud) Muck() error

Muck 人間プレイヤーがハンドをマックする

### func (*SevenCardStud) PlayerAction

func (s *SevenCardStud) PlayerAction(action, amount, humanPlayMs int) error

PlayerAction 人間プレイヤーのアクション実行

### func (*SevenCardStud) Rebuy

func (s *SevenCardStud) Rebuy() error

Rebuy 人間プレイヤーがリバイを実行する

### func (*SevenCardStud) Reset

func (s *SevenCardStud) Reset() error

Reset ゲーム初期化

### func (*SevenCardStud) ResetProfile

func (s *SevenCardStud) ResetProfile()

ResetProfile メタAIプロファイルをリセットする

### func (*SevenCardStud) Resize

func (s *SevenCardStud) Resize(players []*SevenCardStudPlayer)

Resize プレイヤースライスを差し替え

### func (*SevenCardStud) SetConfig

func (s *SevenCardStud) SetConfig(cfg SevenCardStudConfig)

SetConfig 設定変更

### func (*SevenCardStud) ShowHand

func (s *SevenCardStud) ShowHand() error

ShowHand 人間プレイヤーがハンドを公開する

### func (*SevenCardStud) SkipAddon

func (s *SevenCardStud) SkipAddon() error

SkipAddon 人間プレイヤーがアドオンを辞退する

### func (*SevenCardStud) SkipRebuy

func (s *SevenCardStud) SkipRebuy() error

SkipRebuy 人間プレイヤーがリバイを辞退する

### func (*SevenCardStud) UnmarshalJSON

func (s *SevenCardStud) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type SevenCardStudConfig

SevenCardStudConfig セブンカードスタッド設定

type SevenCardStudConfig struct {
    Ante             int              // アンティ
    BringIn          int              // ブリングイン
    SmallBet         int              // スモールベット (3rd-4th Street)
    BigBet           int              // ビッグベット (5th-7th Street)
    InitChips        int              // 初期チップ
    BettingLimit     BettingLimitType // ベッティングリミット
    TableSize        int              // テーブルサイズ (2-7)
    TournamentMode   bool             // トーナメントモード
    AnteLevelHands   int              // アンティレベルアップまでのハンド数
    AnteMultiplier   int              // アンティ倍率 (百分率: 200=2倍)
    RebuyEnabled     bool             // リバイ有効
    RebuyMaxCount    int              // リバイ最大回数
    RebuyChips       int              // リバイ時の補充チップ
    RebuyPeriodHands int              // リバイ可能期間 (ハンド数)
    AddonEnabled     bool             // アドオン有効
    AddonChips       int              // アドオン時の補充チップ
    AddonAfterHand   int              // アドオン提供ハンド番号
    CpuMetaAI        bool             // メタAI: セッション内学習
}

### func DefaultSevenCardStudConfig

func DefaultSevenCardStudConfig() SevenCardStudConfig

DefaultSevenCardStudConfig デフォルト設定

### func (SevenCardStudConfig) Validate

func (c SevenCardStudConfig) Validate() error

Validate 設定値のドメインバリデーション

## type SevenCardStudCpuAction

SevenCardStudCpuAction CPU行動記録

type SevenCardStudCpuAction struct {
    PlayerIdx int // プレイヤーインデックス
    Action    int // アクション
    Amount    int // 金額
}

## type SevenCardStudPlayStyle

SevenCardStudPlayStyle CPUプレイスタイル (Holdemと共通)

type SevenCardStudPlayStyle = HoldemPlayStyle

### func DefaultSevenCardStudCpuStyles

func DefaultSevenCardStudCpuStyles(tableSize int) []SevenCardStudPlayStyle

DefaultSevenCardStudCpuStyles テーブルサイズに応じたCPUスタイルを返す

## type SevenCardStudPlayer

SevenCardStudPlayer セブンカードスタッドプレイヤー

type SevenCardStudPlayer struct {
    Player     // 親クラス (cardsフィールドは使用しない)
    ChipHolder // チップ管理
    // contains filtered or unexported fields
}

### func NewSevenCardStudPlayer

func NewSevenCardStudPlayer(isHuman bool, style SevenCardStudPlayStyle) *SevenCardStudPlayer

NewSevenCardStudPlayer コンストラクタ

### func NewSevenCardStudPlayersForTable

func NewSevenCardStudPlayersForTable(tableSize int) []*SevenCardStudPlayer

NewSevenCardStudPlayersForTable 指定されたテーブルサイズに応じたプレイヤースライスを生成する

### func (*SevenCardStudPlayer) AddDoorCard

func (p *SevenCardStudPlayer) AddDoorCard(c *Card)

AddDoorCard 表向き札を追加する

### func (*SevenCardStudPlayer) AddHoleCard

func (p *SevenCardStudPlayer) AddHoleCard(c *Card)

AddHoleCard 伏せ札を追加する

### func (*SevenCardStudPlayer) ClearCards

func (p *SevenCardStudPlayer) ClearCards()

ClearCards 全カードをクリアする

### func (*SevenCardStudPlayer) EvalBestHand

func (p *SevenCardStudPlayer) EvalBestHand() int

EvalBestHand 全7枚からベスト5枚を評価

### func (*SevenCardStudPlayer) EvalVisibleHand

func (p *SevenCardStudPlayer) EvalVisibleHand() int

EvalVisibleHand 表向き札のみからハンドを評価 (ベッティング順序決定用) 5枚未満の場合はハイカード比較用にソートした値を返す

### func (*SevenCardStudPlayer) GetAFDisplay

func (p *SevenCardStudPlayer) GetAFDisplay() string

GetAFDisplay AF表示文字列取得 (“-”=アクションなし, “∞”=コールなし, “X.X”=通常)

### func (*SevenCardStudPlayer) GetAllCards

func (p *SevenCardStudPlayer) GetAllCards() []*Card

GetAllCards 全カード取得 (伏せ札+表向き札)

### func (*SevenCardStudPlayer) GetBestHand

func (p *SevenCardStudPlayer) GetBestHand() []*Card

GetBestHand ベストハンド取得

### func (*SevenCardStudPlayer) GetComparisonCards

func (p *SevenCardStudPlayer) GetComparisonCards() []*Card

GetComparisonCards ハンド比較用カード取得 (BettingPlayerインターフェース)

### func (*SevenCardStudPlayer) GetDoorCards

func (p *SevenCardStudPlayer) GetDoorCards() []*Card

GetDoorCards 表向き札取得

### func (*SevenCardStudPlayer) GetHoleCards

func (p *SevenCardStudPlayer) GetHoleCards() []*Card

GetHoleCards 伏せ札取得

### func (*SevenCardStudPlayer) GetIsHuman

func (p *SevenCardStudPlayer) GetIsHuman() bool

GetIsHuman 人間フラグ取得

### func (*SevenCardStudPlayer) GetPFR

func (p *SevenCardStudPlayer) GetPFR() int

GetPFR PFR%取得 (0 if totalHands==0)

### func (*SevenCardStudPlayer) GetPFRCount

func (p *SevenCardStudPlayer) GetPFRCount() int

GetPFRCount PFR対象ハンド数取得

### func (*SevenCardStudPlayer) GetPlayStyle

func (p *SevenCardStudPlayer) GetPlayStyle() SevenCardStudPlayStyle

GetPlayStyle プレイスタイル取得

### func (*SevenCardStudPlayer) GetPlayStyleName

func (p *SevenCardStudPlayer) GetPlayStyleName() string

GetPlayStyleName プレイスタイル名取得

### func (*SevenCardStudPlayer) GetPostFlopBetRaise

func (p *SevenCardStudPlayer) GetPostFlopBetRaise() int

GetPostFlopBetRaise ポストフロップ ベット+レイズ回数取得

### func (*SevenCardStudPlayer) GetPostFlopCall

func (p *SevenCardStudPlayer) GetPostFlopCall() int

GetPostFlopCall ポストフロップ コール回数取得

### func (*SevenCardStudPlayer) GetThreeBet

func (p *SevenCardStudPlayer) GetThreeBet() int

GetThreeBet 3Bet%取得 (0 if threeBetOpportunity==0)

### func (*SevenCardStudPlayer) GetThreeBetCount

func (p *SevenCardStudPlayer) GetThreeBetCount() int

GetThreeBetCount 3Bet実行数取得

### func (*SevenCardStudPlayer) GetThreeBetOpportunity

func (p *SevenCardStudPlayer) GetThreeBetOpportunity() int

GetThreeBetOpportunity 3Bet機会数取得

### func (*SevenCardStudPlayer) GetTotalHands

func (p *SevenCardStudPlayer) GetTotalHands() int

GetTotalHands 総ハンド数取得

### func (*SevenCardStudPlayer) GetVPIP

func (p *SevenCardStudPlayer) GetVPIP() int

GetVPIP VPIP%取得 (0 if totalHands==0)

### func (*SevenCardStudPlayer) GetVPIPCount

func (p *SevenCardStudPlayer) GetVPIPCount() int

GetVPIPCount VPIP対象ハンド数取得

### func (*SevenCardStudPlayer) IncrementPFR

func (p *SevenCardStudPlayer) IncrementPFR()

IncrementPFR PFR対象ハンド数をインクリメント

### func (*SevenCardStudPlayer) IncrementPostFlopBetRaise

func (p *SevenCardStudPlayer) IncrementPostFlopBetRaise()

IncrementPostFlopBetRaise ポストフロップ ベット+レイズ回数をインクリメント

### func (*SevenCardStudPlayer) IncrementPostFlopCall

func (p *SevenCardStudPlayer) IncrementPostFlopCall()

IncrementPostFlopCall ポストフロップ コール回数をインクリメント

### func (*SevenCardStudPlayer) IncrementThreeBet

func (p *SevenCardStudPlayer) IncrementThreeBet()

IncrementThreeBet 3Bet実行数をインクリメント

### func (*SevenCardStudPlayer) IncrementThreeBetOpportunity

func (p *SevenCardStudPlayer) IncrementThreeBetOpportunity()

IncrementThreeBetOpportunity 3Bet機会数をインクリメント

### func (*SevenCardStudPlayer) IncrementTotalHands

func (p *SevenCardStudPlayer) IncrementTotalHands()

IncrementTotalHands 総ハンド数をインクリメント

### func (*SevenCardStudPlayer) IncrementVPIP

func (p *SevenCardStudPlayer) IncrementVPIP()

IncrementVPIP VPIP対象ハンド数をインクリメント

### func (*SevenCardStudPlayer) MarshalJSON

func (p *SevenCardStudPlayer) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*SevenCardStudPlayer) UnmarshalJSON

func (p *SevenCardStudPlayer) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type SevenCardStudResult

SevenCardStudResult ショーダウン結果

type SevenCardStudResult struct {
    PlayerIdx int     // プレイヤーインデックス
    HandRank  int     // ハンドランク
    HandName  string  // ハンド名
    BestHand  []*Card // ベスト5枚
    Kickers   []int   // キッカーカード値
    WonAmount int     // 獲得チップ
    Mucked    bool    // マックしたかどうか
}

## type SevenCardStudSidePot

SevenCardStudSidePot サイドポット (共通SidePot型のエイリアス)

type SevenCardStudSidePot = SidePot

## type Sevens

Sevens 7並べゲームクラス ボードは各スートごとにビットマスクで管理する (bit i = 値iが配置済み)

type Sevens struct {
    // contains filtered or unexported fields
}

### func NewSevens

func NewSevens(trumpCards *TrumpCards, players []*SevensPlayer, config SevensConfig) *Sevens

NewSevens コンストラクタ

### func (*Sevens) AutoHandleNoOption

func (s *Sevens) AutoHandleNoOption()

AutoHandleNoOption 現在のプレイヤーに選択肢がない場合の自動処理 (出せるカードもパスも不可 → 失格)

### func (*Sevens) CpuPlay

func (s *Sevens) CpuPlay()

CpuPlay 現在の手番がCPUの場合に1ターン実行

### func (*Sevens) GetActionLog

func (s *Sevens) GetActionLog() []*ActionLogEntry

GetActionLog 棋譜を取得する

### func (*Sevens) GetConfig

func (s *Sevens) GetConfig() SevensConfig

GetConfig ゲーム設定取得

### func (*Sevens) GetCpuActions

func (s *Sevens) GetCpuActions() []*SevensCpuAction

GetCpuActions CPUターンの行動履歴取得

### func (*Sevens) GetCurrentTurn

func (s *Sevens) GetCurrentTurn() int

GetCurrentTurn 現在の手番プレイヤーインデックス取得

### func (*Sevens) GetGameEndFlag

func (s *Sevens) GetGameEndFlag() bool

GetGameEndFlag ゲーム終了フラグ取得

### func (*Sevens) GetHumanAction

func (s *Sevens) GetHumanAction() *SevensCpuAction

GetHumanAction 人間の最後の行動取得

### func (*Sevens) GetPlayer

func (s *Sevens) GetPlayer(idx int) *SevensPlayer

GetPlayer プレイヤー取得

### func (*Sevens) GetPlayerCnt

func (s *Sevens) GetPlayerCnt() int

GetPlayerCnt プレイヤー数取得

### func (*Sevens) GetTableMaxVals

func (s *Sevens) GetTableMaxVals() [5]int

GetTableMaxVals ボードの各スートの最大値取得 (ビットマスクから算出)

### func (*Sevens) GetTableMinVals

func (s *Sevens) GetTableMinVals() [5]int

GetTableMinVals ボードの各スートの最小値取得 (ビットマスクから算出)

### func (*Sevens) GetTablePlaced

func (s *Sevens) GetTablePlaced() [5]uint16

GetTablePlaced ボードのビットマスク取得

### func (*Sevens) HasAnyOption

func (s *Sevens) HasAnyOption(playerIdx int) bool

HasAnyOption 指定プレイヤーが何らかの行動 (出す/パス) を取れるか

### func (*Sevens) IsHumanTurn

func (s *Sevens) IsHumanTurn() bool

IsHumanTurn 現在の手番が人間かどうか

### func (*Sevens) IsPlayable

func (s *Sevens) IsPlayable(card *Card) bool

IsPlayable カードが現在のボード状態に出せるか判定

### func (*Sevens) MarshalJSON

func (s *Sevens) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*Sevens) PlayerPlay

func (s *Sevens) PlayerPlay(idx int) error

PlayerPlay 人間プレイヤーがカードを出す (または パスする) idx: 出すカードのインデックス。-1 の場合はパス。

### func (*Sevens) PlayerPlayJoker

func (s *Sevens) PlayerPlayJoker(cardIdx, targetSuit, targetValue int) error

PlayerPlayJoker 人間プレイヤーがジョーカーを指定ポジションに出す cardIdx: ジョーカーの手札インデックス targetSuit: 配置先スート, targetValue: 配置先値

### func (*Sevens) Reset

func (s *Sevens) Reset()

Reset ゲーム初期化

### func (*Sevens) SetConfig

func (s *Sevens) SetConfig(config SevensConfig)

SetConfig 設定変更

### func (*Sevens) UnmarshalJSON

func (s *Sevens) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type SevensConfig

SevensConfig 7並べゲーム設定

type SevensConfig struct {
    TunnelEnabled          bool `json:"te"` // トンネルルール (A↔K循環)
    TunnelSkipWidth        int  `json:"tw"` // カスタムトンネル: スキップ幅 (0=無効, 2以上で±N接続を追加。TunnelEnabled時は循環ラップあり)
    JokerCount             int  `json:"jc"` // ジョーカー枚数
    CpuStrategy            int  `json:"cs"` // CPU戦略モード (0=シンプル, 1=戦略的, 2=嫌がらせ特化)
    MaxPasses              int  `json:"mp"` // 最大パス回数 (0 = 無制限)
    NoJokerFinish          bool `json:"nj"` // ジョーカー上がり禁止
    JokerReclaimEnabled    bool `json:"jr"` // ジョーカー回収 (ジョーカー配置位置に本物のカードを出すとジョーカーが手札に戻る)
    EndStopEnabled         bool `json:"es"` // 片側ストップ (Aを置くと上側8-Kがブロック、Kを置くと下側A-6がブロック)
    JokerConsecutiveBanned bool `json:"jb"` // ジョーカー連続禁止 (前のターンにジョーカーを出した場合、次のターンにジョーカーを出せない)
}

### func DefaultSevensConfig

func DefaultSevensConfig() SevensConfig

DefaultSevensConfig デフォルト設定 (全機能無効)

## type SevensCpuAction

SevensCpuAction CPUまたは人間の1ターン分の行動記録

type SevensCpuAction struct {
    PlayerIdx   int   `json:"pi"` // 行動したプレイヤーインデックス
    PlayedCard  *Card `json:"pc"` // 出したカード (nil = パスまたは失格)
    TargetSuit  int   `json:"ts"` // ジョーカー配置先スート (ジョーカー以外は0)
    TargetValue int   `json:"tv"` // ジョーカー配置先値 (ジョーカー以外は0)
    ForcedPass  bool  `json:"fp"` // true = 出せるカードがなくパスした
}

## type SevensPlayer

SevensPlayer 7並べプレイヤークラス

type SevensPlayer struct {
    *RankedGamePlayer
    // contains filtered or unexported fields
}

### func NewSevensPlayer

func NewSevensPlayer(isHuman bool) *SevensPlayer

NewSevensPlayer コンストラクタ

### func (*SevensPlayer) CanPass

func (p *SevensPlayer) CanPass() bool

CanPass パス可能かどうか (maxPasses == 0 は無制限, それ以外は使用済みパス < 最大パス)

### func (*SevensPlayer) GetIsEliminated

func (p *SevensPlayer) GetIsEliminated() bool

GetIsEliminated 失格かどうか

### func (*SevensPlayer) GetLastPlayedJoker

func (p *SevensPlayer) GetLastPlayedJoker() bool

GetLastPlayedJoker 前回ジョーカーを出したか取得

### func (*SevensPlayer) GetMaxPasses

func (p *SevensPlayer) GetMaxPasses() int

GetMaxPasses 最大パス回数取得

### func (*SevensPlayer) GetPassesUsed

func (p *SevensPlayer) GetPassesUsed() int

GetPassesUsed 使用済みパス回数取得

### func (*SevensPlayer) IncrPassesUsed

func (p *SevensPlayer) IncrPassesUsed()

IncrPassesUsed パス回数をインクリメント

### func (*SevensPlayer) MarshalJSON

func (p *SevensPlayer) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*SevensPlayer) RemoveSevens

func (p *SevensPlayer) RemoveSevens() []*Card

RemoveSevens 手札からすべての7を取り除いて返す

### func (*SevensPlayer) ResetPasses

func (p *SevensPlayer) ResetPasses()

ResetPasses パス回数リセット

### func (*SevensPlayer) SetIsEliminated

func (p *SevensPlayer) SetIsEliminated(v bool)

SetIsEliminated 失格フラグ設定

### func (*SevensPlayer) SetLastPlayedJoker

func (p *SevensPlayer) SetLastPlayedJoker(v bool)

SetLastPlayedJoker 前回ジョーカーを出したかフラグ設定

### func (*SevensPlayer) SetMaxPasses

func (p *SevensPlayer) SetMaxPasses(n int)

SetMaxPasses 最大パス回数設定 (0 = 無制限)

### func (*SevensPlayer) SortCards

func (p *SevensPlayer) SortCards()

SortCards カードをスートごと・値の昇順でソート

### func (*SevensPlayer) UnmarshalJSON

func (p *SevensPlayer) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type ShortDeck

ShortDeck ショートデックホールデムクラス

type ShortDeck struct {
    // contains filtered or unexported fields
}

### func NewShortDeck

func NewShortDeck(trumpCards *TrumpCards, players []*ShortDeckPlayer, config ShortDeckConfig) *ShortDeck

NewShortDeck コンストラクタ

### func (*ShortDeck) Addon

func (sd *ShortDeck) Addon() error

Addon 人間プレイヤーがアドオンを実行する

### func (*ShortDeck) ExportProfile

func (sd *ShortDeck) ExportProfile() interface{}

ExportProfile メタAIプロファイルをエクスポートする (プロファイルがない場合はnil)

### func (*ShortDeck) GetActedFlags

func (sd *ShortDeck) GetActedFlags() []bool

GetActedFlags actedフラグ取得

### func (*ShortDeck) GetActionLog

func (sd *ShortDeck) GetActionLog() []*ActionLogEntry

GetActionLog 棋譜を取得する

### func (*ShortDeck) GetAddonUsed

func (sd *ShortDeck) GetAddonUsed() []bool

GetAddonUsed プレイヤーごとのアドオン使用フラグ取得

### func (*ShortDeck) GetCommunityCards

func (sd *ShortDeck) GetCommunityCards() []*Card

GetCommunityCards コミュニティカード取得

### func (*ShortDeck) GetConfig

func (sd *ShortDeck) GetConfig() ShortDeckConfig

GetConfig 設定取得

### func (*ShortDeck) GetCpuActions

func (sd *ShortDeck) GetCpuActions() []ShortDeckCpuAction

GetCpuActions CPU行動記録取得

### func (*ShortDeck) GetCurrentTurn

func (sd *ShortDeck) GetCurrentTurn() int

GetCurrentTurn 現在のターン取得

### func (*ShortDeck) GetDealerIdx

func (sd *ShortDeck) GetDealerIdx() int

GetDealerIdx ディーラーインデックス取得

### func (*ShortDeck) GetEquity

func (sd *ShortDeck) GetEquity() *HoldemEquityResult

GetEquity エクイティ計算結果を返す

### func (*ShortDeck) GetGameEndFlag

func (sd *ShortDeck) GetGameEndFlag() bool

GetGameEndFlag ゲーム終了フラグ取得

### func (*ShortDeck) GetHandCount

func (sd *ShortDeck) GetHandCount() int

GetHandCount ハンド数取得

### func (*ShortDeck) GetHumanProfile

func (sd *ShortDeck) GetHumanProfile() *BettingHumanProfile

GetHumanProfile メタAIプロファイル取得

### func (*ShortDeck) GetLastBet

func (sd *ShortDeck) GetLastBet() int

GetLastBet 最後のベット取得

### func (*ShortDeck) GetLastCpuError

func (sd *ShortDeck) GetLastCpuError() error

GetLastCpuError 最後のCPUアクションエラー取得

### func (*ShortDeck) GetMinRaise

func (sd *ShortDeck) GetMinRaise() int

GetMinRaise 最小レイズ額取得

### func (*ShortDeck) GetPhase

func (sd *ShortDeck) GetPhase() int

GetPhase フェーズ取得

### func (*ShortDeck) GetPlayer

func (sd *ShortDeck) GetPlayer(i int) *ShortDeckPlayer

GetPlayer 指定プレイヤー取得

### func (*ShortDeck) GetPlayerCnt

func (sd *ShortDeck) GetPlayerCnt() int

GetPlayerCnt プレイヤー数取得

### func (*ShortDeck) GetPlayers

func (sd *ShortDeck) GetPlayers() []*ShortDeckPlayer

GetPlayers プレイヤー一覧取得

### func (*ShortDeck) GetPot

func (sd *ShortDeck) GetPot() int

GetPot ポット取得

### func (*ShortDeck) GetPotOdds

func (sd *ShortDeck) GetPotOdds() float64

GetPotOdds ポットオッズを返す

### func (*ShortDeck) GetRaiseCount

func (sd *ShortDeck) GetRaiseCount() int

GetRaiseCount 現在のレイズ回数取得

### func (*ShortDeck) GetRebuyCounts

func (sd *ShortDeck) GetRebuyCounts() []int

GetRebuyCounts プレイヤーごとのリバイ回数取得

### func (*ShortDeck) GetRebuyPhaseType

func (sd *ShortDeck) GetRebuyPhaseType() int

GetRebuyPhaseType リバイフェーズ種別取得

### func (*ShortDeck) GetRoundResults

func (sd *ShortDeck) GetRoundResults() []ShortDeckResult

GetRoundResults ラウンド結果取得

### func (*ShortDeck) GetSidePots

func (sd *ShortDeck) GetSidePots() []ShortDeckSidePot

GetSidePots サイドポット取得

### func (*ShortDeck) ImportProfile

func (sd *ShortDeck) ImportProfile(data []byte) error

ImportProfile JSONバイトからメタAIプロファイルをインポートする

### func (*ShortDeck) IsAddonAvailable

func (sd *ShortDeck) IsAddonAvailable() bool

IsAddonAvailable 人間プレイヤーがアドオン可能かどうか

### func (*ShortDeck) IsHumanTurn

func (sd *ShortDeck) IsHumanTurn() bool

IsHumanTurn 人間のターンかチェック

### func (*ShortDeck) IsMuckAvailable

func (sd *ShortDeck) IsMuckAvailable() bool

IsMuckAvailable 人間プレイヤーがマック可能かどうか

### func (*ShortDeck) IsRebuyAvailable

func (sd *ShortDeck) IsRebuyAvailable() bool

IsRebuyAvailable 人間プレイヤーがリバイ可能かどうか

### func (*ShortDeck) MarshalJSON

func (sd *ShortDeck) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*ShortDeck) Muck

func (sd *ShortDeck) Muck() error

Muck 人間プレイヤーがハンドをマックする

### func (*ShortDeck) PlayerAction

func (sd *ShortDeck) PlayerAction(action, amount, humanPlayMs int) error

PlayerAction 人間プレイヤーのアクション実行 humanPlayMs: 迷い時間(ms, 0=計測なし)

### func (*ShortDeck) Rebuy

func (sd *ShortDeck) Rebuy() error

Rebuy 人間プレイヤーがリバイを実行する

### func (*ShortDeck) Reset

func (sd *ShortDeck) Reset() error

Reset ゲーム初期化

### func (*ShortDeck) ResetProfile

func (sd *ShortDeck) ResetProfile()

ResetProfile メタAIプロファイルをリセットする

### func (*ShortDeck) Resize

func (sd *ShortDeck) Resize(players []*ShortDeckPlayer)

Resize プレイヤースライスを差し替え、プレイヤー数依存スライスを再初期化する

### func (*ShortDeck) SetConfig

func (sd *ShortDeck) SetConfig(cfg ShortDeckConfig)

SetConfig 設定変更

### func (*ShortDeck) ShowHand

func (sd *ShortDeck) ShowHand() error

ShowHand 人間プレイヤーがハンドを公開する

### func (*ShortDeck) SkipAddon

func (sd *ShortDeck) SkipAddon() error

SkipAddon 人間プレイヤーがアドオンを辞退する

### func (*ShortDeck) SkipRebuy

func (sd *ShortDeck) SkipRebuy() error

SkipRebuy 人間プレイヤーがリバイを辞退する

### func (*ShortDeck) UnmarshalJSON

func (sd *ShortDeck) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type ShortDeckConfig

ShortDeckConfig ショートデックホールデム設定 (HoldemConfigと同一構造)

type ShortDeckConfig = HoldemConfig

### func DefaultShortDeckConfig

func DefaultShortDeckConfig() ShortDeckConfig

DefaultShortDeckConfig デフォルト設定

## type ShortDeckCpuAction

ShortDeckCpuAction CPU行動記録

type ShortDeckCpuAction = HoldemCpuAction

## type ShortDeckPlayStyle

ShortDeckPlayStyle CPUプレイスタイル (HoldemPlayStyleと同一)

type ShortDeckPlayStyle = HoldemPlayStyle

## type ShortDeckPlayer

ShortDeckPlayer ショートデックホールデムプレイヤークラス

type ShortDeckPlayer struct {
    Player     // 親クラス
    ChipHolder // チップ管理
    // contains filtered or unexported fields
}

### func NewShortDeckPlayer

func NewShortDeckPlayer(isHuman bool, style HoldemPlayStyle) *ShortDeckPlayer

NewShortDeckPlayer コンストラクタ

### func NewShortDeckPlayersForTable

func NewShortDeckPlayersForTable(tableSize int) []*ShortDeckPlayer

NewShortDeckPlayersForTable 指定されたテーブルサイズに応じたショートデックプレイヤースライスを生成する

### func (*ShortDeckPlayer) EvalBestHand

func (sp *ShortDeckPlayer) EvalBestHand(communityCards []*Card) int

EvalBestHand コミュニティカードとホールカード(2枚)からベスト5枚を評価 (ショートデック用)

### func (*ShortDeckPlayer) GetAFDisplay

func (sp *ShortDeckPlayer) GetAFDisplay() string

GetAFDisplay AF表示文字列取得 (“-”=アクションなし, “∞”=コールなし, “X.X”=通常)

### func (*ShortDeckPlayer) GetBestHand

func (sp *ShortDeckPlayer) GetBestHand() []*Card

GetBestHand ベストハンド取得

### func (*ShortDeckPlayer) GetComparisonCards

func (sp *ShortDeckPlayer) GetComparisonCards() []*Card

GetComparisonCards ハンド比較用カード取得 (BettingPlayerインターフェース)

### func (*ShortDeckPlayer) GetIsHuman

func (sp *ShortDeckPlayer) GetIsHuman() bool

GetIsHuman 人間フラグ取得

### func (*ShortDeckPlayer) GetPFR

func (sp *ShortDeckPlayer) GetPFR() int

GetPFR PFR%取得 (0 if totalHands==0)

### func (*ShortDeckPlayer) GetPFRCount

func (sp *ShortDeckPlayer) GetPFRCount() int

GetPFRCount PFR対象ハンド数取得

### func (*ShortDeckPlayer) GetPlayStyle

func (sp *ShortDeckPlayer) GetPlayStyle() HoldemPlayStyle

GetPlayStyle プレイスタイル取得

### func (*ShortDeckPlayer) GetPlayStyleName

func (sp *ShortDeckPlayer) GetPlayStyleName() string

GetPlayStyleName プレイスタイル名取得

### func (*ShortDeckPlayer) GetPostFlopBetRaise

func (sp *ShortDeckPlayer) GetPostFlopBetRaise() int

GetPostFlopBetRaise ポストフロップ ベット+レイズ回数取得

### func (*ShortDeckPlayer) GetPostFlopCall

func (sp *ShortDeckPlayer) GetPostFlopCall() int

GetPostFlopCall ポストフロップ コール回数取得

### func (*ShortDeckPlayer) GetThreeBet

func (sp *ShortDeckPlayer) GetThreeBet() int

GetThreeBet 3Bet%取得 (0 if threeBetOpportunity==0)

### func (*ShortDeckPlayer) GetThreeBetCount

func (sp *ShortDeckPlayer) GetThreeBetCount() int

GetThreeBetCount 3Bet実行数取得

### func (*ShortDeckPlayer) GetThreeBetOpportunity

func (sp *ShortDeckPlayer) GetThreeBetOpportunity() int

GetThreeBetOpportunity 3Bet機会数取得

### func (*ShortDeckPlayer) GetTotalHands

func (sp *ShortDeckPlayer) GetTotalHands() int

GetTotalHands 総ハンド数取得

### func (*ShortDeckPlayer) GetVPIP

func (sp *ShortDeckPlayer) GetVPIP() int

GetVPIP VPIP%取得 (0 if totalHands==0)

### func (*ShortDeckPlayer) GetVPIPCount

func (sp *ShortDeckPlayer) GetVPIPCount() int

GetVPIPCount VPIP対象ハンド数取得

### func (*ShortDeckPlayer) IncrementPFR

func (sp *ShortDeckPlayer) IncrementPFR()

IncrementPFR PFR対象ハンド数をインクリメント

### func (*ShortDeckPlayer) IncrementPostFlopBetRaise

func (sp *ShortDeckPlayer) IncrementPostFlopBetRaise()

IncrementPostFlopBetRaise ポストフロップ ベット+レイズ回数をインクリメント

### func (*ShortDeckPlayer) IncrementPostFlopCall

func (sp *ShortDeckPlayer) IncrementPostFlopCall()

IncrementPostFlopCall ポストフロップ コール回数をインクリメント

### func (*ShortDeckPlayer) IncrementThreeBet

func (sp *ShortDeckPlayer) IncrementThreeBet()

IncrementThreeBet 3Bet実行数をインクリメント

### func (*ShortDeckPlayer) IncrementThreeBetOpportunity

func (sp *ShortDeckPlayer) IncrementThreeBetOpportunity()

IncrementThreeBetOpportunity 3Bet機会数をインクリメント

### func (*ShortDeckPlayer) IncrementTotalHands

func (sp *ShortDeckPlayer) IncrementTotalHands()

IncrementTotalHands 総ハンド数をインクリメント

### func (*ShortDeckPlayer) IncrementVPIP

func (sp *ShortDeckPlayer) IncrementVPIP()

IncrementVPIP VPIP対象ハンド数をインクリメント

### func (*ShortDeckPlayer) MarshalJSON

func (sp *ShortDeckPlayer) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*ShortDeckPlayer) UnmarshalJSON

func (sp *ShortDeckPlayer) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type ShortDeckResult

ShortDeckResult ショーダウン結果

type ShortDeckResult = HoldemResult

## type ShortDeckSidePot

ShortDeckSidePot サイドポット (共通SidePot型のエイリアス)

type ShortDeckSidePot = SidePot

## type SidePot

SidePot サイドポット (Poker/Holdem共通)

type SidePot struct {
    Amount          int   // ポット額
    EligiblePlayers []int // 受取対象プレイヤーインデックス
}

### func CalculateSidePots

func CalculateSidePots(players []BettingPlayer, pot int, startingChips []int) []SidePot

CalculateSidePots サイドポット計算

## type Spades

Spades スペードゲームクラス

type Spades struct {
    // contains filtered or unexported fields
}

### func NewSpades

func NewSpades(trumpCards *TrumpCards, players []*SpadesPlayer, config SpadesConfig) *Spades

NewSpades コンストラクタ

### func (*Spades) CpuBid

func (s *Spades) CpuBid()

CpuBid 現在のビッドプレイヤーがCPUの場合にビッドする

### func (*Spades) CpuPlay

func (s *Spades) CpuPlay()

CpuPlay 現在の手番がCPUの場合に1ターン実行

### func (*Spades) GetActionLog

func (s *Spades) GetActionLog() []*ActionLogEntry

GetActionLog 棋譜取得

### func (*Spades) GetBidPlayerIdx

func (s *Spades) GetBidPlayerIdx() int

GetBidPlayerIdx ビッドプレイヤーインデックス取得

### func (*Spades) GetConfig

func (s *Spades) GetConfig() SpadesConfig

GetConfig 設定取得

### func (*Spades) GetCurrentPlayerIdx

func (s *Spades) GetCurrentPlayerIdx() int

GetCurrentPlayerIdx 現在のプレイヤーインデックス取得

### func (*Spades) GetCurrentTrick

func (s *Spades) GetCurrentTrick() []*SpadesTrickCard

GetCurrentTrick 現在のトリック取得

### func (*Spades) GetGameEndFlag

func (s *Spades) GetGameEndFlag() bool

GetGameEndFlag ゲーム終了フラグ取得

### func (*Spades) GetHint

func (s *Spades) GetHint() *SpadesHint

GetHint ヒントを取得する

### func (*Spades) GetLeadPlayerIdx

func (s *Spades) GetLeadPlayerIdx() int

GetLeadPlayerIdx リードプレイヤーインデックス取得

### func (*Spades) GetPhase

func (s *Spades) GetPhase() SpadesPhase

GetPhase 現在のフェーズ取得

### func (*Spades) GetPlayer

func (s *Spades) GetPlayer(i int) *SpadesPlayer

GetPlayer プレイヤー取得

### func (*Spades) GetPlayerCnt

func (s *Spades) GetPlayerCnt() int

GetPlayerCnt プレイヤー数取得

### func (*Spades) GetRoundNumber

func (s *Spades) GetRoundNumber() int

GetRoundNumber 現在のラウンド番号取得

### func (*Spades) GetSpadesBroken

func (s *Spades) GetSpadesBroken() bool

GetSpadesBroken スペードブレイク状態取得

### func (*Spades) GetTrickNumber

func (s *Spades) GetTrickNumber() int

GetTrickNumber 現在のトリック番号取得

### func (*Spades) GetValidPlayIndices

func (s *Spades) GetValidPlayIndices(playerIdx int) []int

GetValidPlayIndices プレイ可能なカードのインデックスリストを返す (Web用)

### func (*Spades) GetWinnerIdx

func (s *Spades) GetWinnerIdx() int

GetWinnerIdx 勝者インデックス取得 (-1 = 未確定)

### func (*Spades) IsHumanBidTurn

func (s *Spades) IsHumanBidTurn() bool

IsHumanBidTurn 現在のビッド手番が人間かどうか

### func (*Spades) IsHumanTurn

func (s *Spades) IsHumanTurn() bool

IsHumanTurn 現在の手番が人間かどうか

### func (*Spades) MarshalJSON

func (s *Spades) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*Spades) NextRound

func (s *Spades) NextRound()

NextRound 次のラウンドを開始する

### func (*Spades) NextTrick

func (s *Spades) NextTrick()

NextTrick 次のトリックを開始する

### func (*Spades) PlayerBid

func (s *Spades) PlayerBid(bid int) error

PlayerBid 人間プレイヤーがビッドする

### func (*Spades) PlayerPlay

func (s *Spades) PlayerPlay(cardIndex int) error

PlayerPlay 人間プレイヤーがカードをプレイする

### func (*Spades) Reset

func (s *Spades) Reset()

Reset ゲーム初期化

### func (*Spades) ResolveTrick

func (s *Spades) ResolveTrick()

ResolveTrick トリックを解決して勝者を決定する

### func (*Spades) ScoreRound

func (s *Spades) ScoreRound()

ScoreRound ラウンドのスコアを確定し、ゲーム終了判定を行う

### func (*Spades) SetBidPlayerIdx

func (s *Spades) SetBidPlayerIdx(idx int)

SetBidPlayerIdx ビッドプレイヤーインデックス設定 (テスト用)

### func (*Spades) SetConfig

func (s *Spades) SetConfig(cfg SpadesConfig)

SetConfig 設定変更

### func (*Spades) SetCurrentPlayerIdx

func (s *Spades) SetCurrentPlayerIdx(idx int)

SetCurrentPlayerIdx プレイヤーインデックス設定 (テスト用)

### func (*Spades) SetCurrentTrick

func (s *Spades) SetCurrentTrick(trick []*SpadesTrickCard)

SetCurrentTrick トリック設定 (テスト用)

### func (*Spades) SetLeadPlayerIdx

func (s *Spades) SetLeadPlayerIdx(idx int)

SetLeadPlayerIdx リードプレイヤーインデックス設定 (テスト用)

### func (*Spades) SetPhase

func (s *Spades) SetPhase(phase SpadesPhase)

SetPhase フェーズ設定 (テスト用)

### func (*Spades) SetRoundNumber

func (s *Spades) SetRoundNumber(n int)

SetRoundNumber ラウンド番号設定 (テスト用)

### func (*Spades) SetSpadesBroken

func (s *Spades) SetSpadesBroken(broken bool)

SetSpadesBroken スペードブレイク状態設定 (テスト用)

### func (*Spades) SetTrickNumber

func (s *Spades) SetTrickNumber(n int)

SetTrickNumber トリック番号設定 (テスト用)

### func (*Spades) UnmarshalJSON

func (s *Spades) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type SpadesConfig

SpadesConfig スペードゲーム設定

type SpadesConfig struct {
    CpuDifficulty       SpadesCpuDifficulty `json:"cd"`
    PointLimit          int                 `json:"pl"` // ゲーム終了スコア (先に到達したプレイヤーが勝利)
    NilBonus            int                 `json:"nb"` // ニルビッド成功時のボーナス
    BagPenaltyThreshold int                 `json:"bt"` // バッグペナルティの閾値 (累積10バッグごとに-100)
}

### func DefaultSpadesConfig

func DefaultSpadesConfig() SpadesConfig

DefaultSpadesConfig デフォルト設定を返す

### func (SpadesConfig) Validate

func (c SpadesConfig) Validate() error

Validate 設定値のドメインバリデーション

## type SpadesCpuDifficulty

SpadesCpuDifficulty CPU の難易度レベル

type SpadesCpuDifficulty int

SpadesのCPU難易度定数

const (
    // SpadesCpuDifficultyEasy 低難易度
    SpadesCpuDifficultyEasy SpadesCpuDifficulty = iota
    // SpadesCpuDifficultyNormal 中難易度
    SpadesCpuDifficultyNormal
    // SpadesCpuDifficultyHard 高難易度
    SpadesCpuDifficultyHard
)

## type SpadesHint

SpadesHint ヒント情報

type SpadesHint struct {
    CardIndex *int   // 推奨カードインデックス (ビッド時nil)
    Bid       *int   // 推奨ビッド値 (プレイ時nil)
    Reason    string // ヒント理由キー
}

## type SpadesPhase

SpadesPhase ゲームフェーズ

type SpadesPhase int

Spadesのフェーズ定数

const (
    // SpadesPhaseBid ビッドフェーズ
    SpadesPhaseBid SpadesPhase = 0
    // SpadesPhasePlay トリックプレイフェーズ
    SpadesPhasePlay SpadesPhase = 1
    // SpadesPhaseTrickEnd トリック終了フェーズ
    SpadesPhaseTrickEnd SpadesPhase = 2
    // SpadesPhaseRoundEnd ラウンド終了フェーズ
    SpadesPhaseRoundEnd SpadesPhase = 3
    // SpadesPhaseGameEnd ゲーム終了フェーズ
    SpadesPhaseGameEnd SpadesPhase = 4
)

## type SpadesPlayer

SpadesPlayer スペードプレイヤークラス

type SpadesPlayer struct {
    *GamePlayer
    RoundScoreHolder
    TrickHolder
    // contains filtered or unexported fields
}

### func NewSpadesPlayer

func NewSpadesPlayer(isHuman bool) *SpadesPlayer

NewSpadesPlayer コンストラクタ

### func (*SpadesPlayer) GetBags

func (p *SpadesPlayer) GetBags() int

GetBags 累積バッグ数を取得

### func (*SpadesPlayer) GetBid

func (p *SpadesPlayer) GetBid() int

GetBid ビッド取得 (-1 = 未ビッド)

### func (*SpadesPlayer) MarshalJSON

func (p *SpadesPlayer) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*SpadesPlayer) ResetRound

func (p *SpadesPlayer) ResetRound()

ResetRound ラウンドをリセット(ビッド・トリック・手札・終了状態を初期化)

### func (*SpadesPlayer) SetBags

func (p *SpadesPlayer) SetBags(bags int)

SetBags バッグ数を設定

### func (*SpadesPlayer) SetBid

func (p *SpadesPlayer) SetBid(bid int)

SetBid ビッド設定

### func (*SpadesPlayer) UnmarshalJSON

func (p *SpadesPlayer) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type SpadesTrickCard

SpadesTrickCard トリック中の1枚

type SpadesTrickCard struct {
    PlayerIdx int   `json:"pi"`
    Card      *Card `json:"c"`
}

## type Speed

Speed スピードゲームクラス

type Speed struct {
    // contains filtered or unexported fields
}

### func NewSpeed

func NewSpeed(trumpCards *TrumpCards, players []*SpeedPlayer, config SpeedConfig) *Speed

NewSpeed コンストラクタ

### func (*Speed) CanPlay

func (s *Speed) CanPlay(playerIdx, cardIdx, pileIdx int) bool

CanPlay 指定プレイヤーの手札カードが指定台札に出せるか

### func (*Speed) CpuPlay

func (s *Speed) CpuPlay() []*SpeedCpuAction

CpuPlay CPUがカードを出す (難易度に応じて複数枚)

### func (*Speed) Flip

func (s *Speed) Flip() error

Flip 膠着時に台札をめくる

### func (*Speed) GetActionLog

func (s *Speed) GetActionLog() []*ActionLogEntry

GetActionLog 棋譜取得

### func (*Speed) GetCenterPile

func (s *Speed) GetCenterPile(i int) *Card

GetCenterPile 台札取得

### func (*Speed) GetConfig

func (s *Speed) GetConfig() SpeedConfig

GetConfig 設定取得

### func (*Speed) GetGameEndFlag

func (s *Speed) GetGameEndFlag() bool

GetGameEndFlag ゲーム終了フラグ取得

### func (*Speed) GetHint

func (s *Speed) GetHint() (cardIdx, pileIdx int, found bool)

GetHint 人間プレイヤーへのヒントを返す

### func (*Speed) GetPhase

func (s *Speed) GetPhase() SpeedPhase

GetPhase フェーズ取得

### func (*Speed) GetPlayer

func (s *Speed) GetPlayer(i int) *SpeedPlayer

GetPlayer プレイヤー取得

### func (*Speed) GetPlayerCnt

func (s *Speed) GetPlayerCnt() int

GetPlayerCnt プレイヤー数取得

### func (*Speed) GetWinnerIdx

func (s *Speed) GetWinnerIdx() int

GetWinnerIdx 勝者インデックス取得

### func (*Speed) IsHumanTurn

func (s *Speed) IsHumanTurn() bool

IsHumanTurn Speedでは常に人間のターン (同時プレイ)

### func (*Speed) IsStuck

func (s *Speed) IsStuck() bool

IsStuck 膠着状態かどうか

### func (*Speed) MarshalJSON

func (s *Speed) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*Speed) PlayerHasAnyPlay

func (s *Speed) PlayerHasAnyPlay(playerIdx int) bool

PlayerHasAnyPlay 指定プレイヤーに出せる手がある場合 true

### func (*Speed) PlayerPlay

func (s *Speed) PlayerPlay(cardIndex, pileIndex int) error

PlayerPlay 人間プレイヤーがカードを出す

### func (*Speed) Reset

func (s *Speed) Reset()

Reset ゲームをリセットして新しいゲームを開始する

### func (*Speed) SetConfig

func (s *Speed) SetConfig(cfg SpeedConfig)

SetConfig 設定更新

### func (*Speed) UnmarshalJSON

func (s *Speed) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

### func (*Speed) UpdatePhase

func (s *Speed) UpdatePhase()

UpdatePhase 外部からフェーズ更新 (Interactor用)

## type SpeedConfig

SpeedConfig スピードゲーム設定

type SpeedConfig struct {
    CpuDifficulty SpeedCpuDifficulty
}

### func DefaultSpeedConfig

func DefaultSpeedConfig() SpeedConfig

DefaultSpeedConfig デフォルト設定を返す

### func (SpeedConfig) MarshalJSON

func (c SpeedConfig) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*SpeedConfig) UnmarshalJSON

func (c *SpeedConfig) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

### func (SpeedConfig) Validate

func (c SpeedConfig) Validate() error

Validate 設定値の検証

## type SpeedCpuAction

SpeedCpuAction CPUが行ったアクション

type SpeedCpuAction struct {
    CardIndex int // 手札インデックス (出した時点での)
    PileIndex int // 台札インデックス
}

## type SpeedCpuDifficulty

SpeedCpuDifficulty CPUの難易度

type SpeedCpuDifficulty int

Speedの難易度定数

const (
    // SpeedCpuDifficultyEasy ランダムに1枚だけ出す
    SpeedCpuDifficultyEasy SpeedCpuDifficulty = iota
    // SpeedCpuDifficultyNormal 貪欲に複数枚出す
    SpeedCpuDifficultyNormal
    // SpeedCpuDifficultyHard 貪欲+戦略的判断
    SpeedCpuDifficultyHard
)

## type SpeedPhase

SpeedPhase ゲームフェーズ

type SpeedPhase int

Speedのフェーズ定数

const (
    // SpeedPhasePlay プレイフェーズ
    SpeedPhasePlay SpeedPhase = 0
    // SpeedPhaseStuck 膠着フェーズ (めくりが必要)
    SpeedPhaseStuck SpeedPhase = 1
    // SpeedPhaseGameEnd ゲーム終了
    SpeedPhaseGameEnd SpeedPhase = 2
)

## type SpeedPlayer

SpeedPlayer スピードプレイヤークラス

type SpeedPlayer struct {
    *GamePlayer
    // contains filtered or unexported fields
}

### func NewSpeedPlayer

func NewSpeedPlayer(isHuman bool) *SpeedPlayer

NewSpeedPlayer コンストラクタ

### func (*SpeedPlayer) AddToDrawPile

func (p *SpeedPlayer) AddToDrawPile(cards ...*Card)

AddToDrawPile 山札にカードを追加する

### func (*SpeedPlayer) DrawToHand

func (p *SpeedPlayer) DrawToHand() bool

DrawToHand 山札から1枚引いて手札に加える。山札が空なら false を返す。

### func (*SpeedPlayer) GetDrawPileSize

func (p *SpeedPlayer) GetDrawPileSize() int

GetDrawPileSize 山札の枚数を返す

### func (*SpeedPlayer) HasCards

func (p *SpeedPlayer) HasCards() bool

HasCards 手札または山札にカードが残っているか

### func (*SpeedPlayer) MarshalJSON

func (p *SpeedPlayer) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*SpeedPlayer) RefillHand

func (p *SpeedPlayer) RefillHand(maxSize int)

RefillHand 手札が maxSize になるまで山札から引く

### func (*SpeedPlayer) ResetDrawPile

func (p *SpeedPlayer) ResetDrawPile()

ResetDrawPile 山札をリセットする

### func (*SpeedPlayer) UnmarshalJSON

func (p *SpeedPlayer) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type Spider

Spider スパイダーソリティアゲームクラス

type Spider struct {
    // contains filtered or unexported fields
}

### func NewSpider

func NewSpider(trumpCards *TrumpCards) *Spider

NewSpider コンストラクタ

### func (*Spider) AllFaceUp

func (s *Spider) AllFaceUp() bool

AllFaceUp 全カードが表向きかどうか

### func (*Spider) AutoComplete

func (s *Spider) AutoComplete() error

AutoComplete オートコンプリート(全カード表向きの場合に完成スートを自動除去)

### func (*Spider) CanUndo

func (s *Spider) CanUndo() bool

CanUndo アンドゥ可能かどうか

### func (*Spider) Deal

func (s *Spider) Deal() error

Deal ストックからタブローに1枚ずつ配る

### func (*Spider) GetActionLog

func (s *Spider) GetActionLog() []*ActionLogEntry

GetActionLog 棋譜取得

### func (*Spider) GetCompletedSuits

func (s *Spider) GetCompletedSuits() int

GetCompletedSuits 完成スート数取得

### func (*Spider) GetDifficulty

func (s *Spider) GetDifficulty() SpiderDifficulty

GetDifficulty 難易度取得

### func (*Spider) GetHint

func (s *Spider) GetHint() *SpiderHint

GetHint ヒントを取得

### func (*Spider) GetMoveCount

func (s *Spider) GetMoveCount() int

GetMoveCount 移動回数取得

### func (*Spider) GetPhase

func (s *Spider) GetPhase() SpiderPhase

GetPhase フェーズ取得

### func (*Spider) GetScore

func (s *Spider) GetScore() int

GetScore スコア取得

### func (*Spider) GetStockCount

func (s *Spider) GetStockCount() int

GetStockCount ストック枚数取得

### func (*Spider) GetTableau

func (s *Spider) GetTableau() [SpiderTableauCnt][]*SpiderTableauCard

GetTableau タブロー取得

### func (*Spider) GiveUp

func (s *Spider) GiveUp()

GiveUp ギブアップ

### func (*Spider) IsStalemate

func (s *Spider) IsStalemate() bool

IsStalemate 手詰まり状態取得

### func (*Spider) MarshalJSON

func (s *Spider) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*Spider) MoveTableauToTableau

func (s *Spider) MoveTableauToTableau(fromCol, cardIndex, toCol int) error

MoveTableauToTableau タブロー間でカードを移動

### func (*Spider) Reset

func (s *Spider) Reset()

Reset ゲームリセット

### func (*Spider) ResetWithConfig

func (s *Spider) ResetWithConfig(cfg SpiderConfig)

ResetWithConfig 設定付きリセット

### func (*Spider) SetCompletedSuits

func (s *Spider) SetCompletedSuits(n int)

SetCompletedSuits 完成スート数設定 (テスト用)

### func (*Spider) SetIsStalemate

func (s *Spider) SetIsStalemate(v bool)

SetIsStalemate 手詰まり状態設定 (テスト用)

### func (*Spider) SetPhase

func (s *Spider) SetPhase(phase SpiderPhase)

SetPhase フェーズ設定 (テスト用)

### func (*Spider) SetScore

func (s *Spider) SetScore(score int)

SetScore スコア設定 (テスト用)

### func (*Spider) SetStock

func (s *Spider) SetStock(stock []*Card)

SetStock ストック設定 (テスト用)

### func (*Spider) SetTableau

func (s *Spider) SetTableau(tableau [SpiderTableauCnt][]*SpiderTableauCard)

SetTableau タブロー設定 (テスト用)

### func (*Spider) Undo

func (s *Spider) Undo() error

Undo 直前の操作を取り消す

### func (*Spider) UndoN

func (s *Spider) UndoN(n int) error

UndoN n回連続でアンドゥを実行する。

### func (*Spider) UndoToEscape

func (s *Spider) UndoToEscape() int

UndoToEscape 膠着状態から抜けるために必要なアンドゥ回数を返す。膠着状態でなければ0、脱出不可なら-1。

### func (*Spider) UnmarshalJSON

func (s *Spider) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type SpiderConfig

SpiderConfig スパイダーソリティア設定

type SpiderConfig struct {
    Difficulty SpiderDifficulty
}

### func DefaultSpiderConfig

func DefaultSpiderConfig() SpiderConfig

DefaultSpiderConfig デフォルト設定(1スート)

## type SpiderDifficulty

SpiderDifficulty スパイダーソリティア難易度

type SpiderDifficulty int

Spiderの難易度定数

const (
    // SpiderDifficulty1Suit 1スート(初級)
    SpiderDifficulty1Suit SpiderDifficulty = 1
    // SpiderDifficulty2Suit 2スート(中級)
    SpiderDifficulty2Suit SpiderDifficulty = 2
    // SpiderDifficulty4Suit 4スート(上級)
    SpiderDifficulty4Suit SpiderDifficulty = 4
)

## type SpiderHint

SpiderHint ヒント

type SpiderHint struct {
    FromCol   int
    CardIndex int
    ToCol     int
}

## type SpiderPhase

SpiderPhase スパイダーソリティアゲームフェーズ

type SpiderPhase int

Spiderのフェーズ定数

const (
    // SpiderPhasePlaying プレイ中
    SpiderPhasePlaying SpiderPhase = iota
    // SpiderPhaseGameClear ゲームクリア
    SpiderPhaseGameClear
    // SpiderPhaseGameOver ゲームオーバー
    SpiderPhaseGameOver
)

## type SpiderTableauCard

SpiderTableauCard タブロー上のカード

type SpiderTableauCard struct {
    Card   *Card `json:"c"`
    FaceUp bool  `json:"f"`
}

## type ThreeCard

ThreeCard スリーカードポーカークラス

type ThreeCard struct {
    // contains filtered or unexported fields
}

### func NewDefaultThreeCard

func NewDefaultThreeCard() *ThreeCard

NewDefaultThreeCard デフォルト設定のスリーカードポーカーを生成するファクトリ関数

### func NewThreeCard

func NewThreeCard(trumpCards *TrumpCards) *ThreeCard

NewThreeCard コンストラクタ

### func (*ThreeCard) Bet

func (tc *ThreeCard) Bet(ante, pairPlus int) error

Bet アンテベット&カード配布

### func (*ThreeCard) Fold

func (tc *ThreeCard) Fold() error

Fold フォールド(アンテ没収、ペアプラスは別途評価)

### func (*ThreeCard) GetActionLog

func (tc *ThreeCard) GetActionLog() []*ActionLogEntry

GetActionLog 棋譜を取得する

### func (*ThreeCard) GetAnteBet

func (tc *ThreeCard) GetAnteBet() int

GetAnteBet アンテベット額

### func (*ThreeCard) GetAnteBonusPayout

func (tc *ThreeCard) GetAnteBonusPayout() int

GetAnteBonusPayout アンテボーナス配当

### func (*ThreeCard) GetAntePayout

func (tc *ThreeCard) GetAntePayout() int

GetAntePayout アンテ配当

### func (*ThreeCard) GetChips

func (tc *ThreeCard) GetChips() int

GetChips チップ

### func (*ThreeCard) GetDealerHand

func (tc *ThreeCard) GetDealerHand() []*Card

GetDealerHand ディーラーハンド取得

### func (*ThreeCard) GetDealerHandRank

func (tc *ThreeCard) GetDealerHandRank() int

GetDealerHandRank ディーラーハンドランク

### func (*ThreeCard) GetDealerQualified

func (tc *ThreeCard) GetDealerQualified() bool

GetDealerQualified ディーラークオリファイ

### func (*ThreeCard) GetGameEndFlag

func (tc *ThreeCard) GetGameEndFlag() bool

GetGameEndFlag ゲーム終了フラグ

### func (*ThreeCard) GetPairPlusBet

func (tc *ThreeCard) GetPairPlusBet() int

GetPairPlusBet ペアプラスベット額

### func (*ThreeCard) GetPairPlusPayout

func (tc *ThreeCard) GetPairPlusPayout() int

GetPairPlusPayout ペアプラス配当

### func (*ThreeCard) GetPhase

func (tc *ThreeCard) GetPhase() int

GetPhase 現在のフェーズ

### func (*ThreeCard) GetPlayBet

func (tc *ThreeCard) GetPlayBet() int

GetPlayBet プレイベット額

### func (*ThreeCard) GetPlayPayout

func (tc *ThreeCard) GetPlayPayout() int

GetPlayPayout プレイ配当

### func (*ThreeCard) GetPlayerHand

func (tc *ThreeCard) GetPlayerHand() []*Card

GetPlayerHand プレイヤーハンド取得

### func (*ThreeCard) GetPlayerHandRank

func (tc *ThreeCard) GetPlayerHandRank() int

GetPlayerHandRank プレイヤーハンドランク

### func (*ThreeCard) GetResult

func (tc *ThreeCard) GetResult() GameResult

GetResult ゲーム結果

### func (*ThreeCard) GetTotalPayout

func (tc *ThreeCard) GetTotalPayout() int

GetTotalPayout 合計配当

### func (*ThreeCard) MarshalJSON

func (tc *ThreeCard) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*ThreeCard) Play

func (tc *ThreeCard) Play() error

Play プレイ(アンテと同額のプレイベットを置いて勝負)

### func (*ThreeCard) Reset

func (tc *ThreeCard) Reset()

Reset ゲーム初期化

### func (*ThreeCard) SetAnteBet

func (tc *ThreeCard) SetAnteBet(amount int)

SetAnteBet アンテベット額設定(テスト用)

### func (*ThreeCard) SetAnteBonusPayout

func (tc *ThreeCard) SetAnteBonusPayout(payout int)

SetAnteBonusPayout アンテボーナス配当設定(テスト用)

### func (*ThreeCard) SetAntePayout

func (tc *ThreeCard) SetAntePayout(payout int)

SetAntePayout アンテ配当設定(テスト用)

### func (*ThreeCard) SetChips

func (tc *ThreeCard) SetChips(chips int)

SetChips チップ設定(テスト用)

### func (*ThreeCard) SetDealerHand

func (tc *ThreeCard) SetDealerHand(cards []*Card)

SetDealerHand ディーラーハンド設定(テスト用)

### func (*ThreeCard) SetDealerHandRank

func (tc *ThreeCard) SetDealerHandRank(rank int)

SetDealerHandRank ディーラーハンドランク設定(テスト用)

### func (*ThreeCard) SetDealerQualified

func (tc *ThreeCard) SetDealerQualified(qualified bool)

SetDealerQualified ディーラークオリファイ設定(テスト用)

### func (*ThreeCard) SetGameEndFlag

func (tc *ThreeCard) SetGameEndFlag(flag bool)

SetGameEndFlag ゲーム終了フラグ設定(テスト用)

### func (*ThreeCard) SetPairPlusBet

func (tc *ThreeCard) SetPairPlusBet(amount int)

SetPairPlusBet ペアプラスベット額設定(テスト用)

### func (*ThreeCard) SetPairPlusPayout

func (tc *ThreeCard) SetPairPlusPayout(payout int)

SetPairPlusPayout ペアプラス配当設定(テスト用)

### func (*ThreeCard) SetPhase

func (tc *ThreeCard) SetPhase(phase int)

SetPhase フェーズ設定(テスト用)

### func (*ThreeCard) SetPlayBet

func (tc *ThreeCard) SetPlayBet(amount int)

SetPlayBet プレイベット額設定(テスト用)

### func (*ThreeCard) SetPlayPayout

func (tc *ThreeCard) SetPlayPayout(payout int)

SetPlayPayout プレイ配当設定(テスト用)

### func (*ThreeCard) SetPlayerHand

func (tc *ThreeCard) SetPlayerHand(cards []*Card)

SetPlayerHand プレイヤーハンド設定(テスト用)

### func (*ThreeCard) SetPlayerHandRank

func (tc *ThreeCard) SetPlayerHandRank(rank int)

SetPlayerHandRank プレイヤーハンドランク設定(テスト用)

### func (*ThreeCard) SetResult

func (tc *ThreeCard) SetResult(result GameResult)

SetResult ゲーム結果設定(テスト用)

### func (*ThreeCard) UnmarshalJSON

func (tc *ThreeCard) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type TriPeaks

TriPeaks トリピークスソリティアゲームクラス

type TriPeaks struct {
    // contains filtered or unexported fields
}

### func NewTriPeaks

func NewTriPeaks(trumpCards *TrumpCards) *TriPeaks

NewTriPeaks コンストラクタ

### func (*TriPeaks) AllRemoved

func (t *TriPeaks) AllRemoved() bool

AllRemoved 全タブローカードが除去されたか

### func (*TriPeaks) CanUndo

func (t *TriPeaks) CanUndo() bool

CanUndo アンドゥ可能かどうか

### func (*TriPeaks) Draw

func (t *TriPeaks) Draw() error

Draw ストックからウェイストにカードを引く

### func (*TriPeaks) GetActionLog

func (t *TriPeaks) GetActionLog() []*ActionLogEntry

GetActionLog 棋譜取得

### func (*TriPeaks) GetHint

func (t *TriPeaks) GetHint() *TriPeaksHint

GetHint ヒントを取得

### func (*TriPeaks) GetLayout

func (t *TriPeaks) GetLayout() [TriPeaksRowCnt][TriPeaksColCnt]*TriPeaksCard

GetLayout レイアウト取得

### func (*TriPeaks) GetMoveCount

func (t *TriPeaks) GetMoveCount() int

GetMoveCount 移動回数取得

### func (*TriPeaks) GetPhase

func (t *TriPeaks) GetPhase() TriPeaksPhase

GetPhase フェーズ取得

### func (*TriPeaks) GetStockCount

func (t *TriPeaks) GetStockCount() int

GetStockCount ストック枚数取得

### func (*TriPeaks) GetWaste

func (t *TriPeaks) GetWaste() []*Card

GetWaste ウェイスト取得

### func (*TriPeaks) GiveUp

func (t *TriPeaks) GiveUp()

GiveUp ギブアップ

### func (*TriPeaks) IsExposed

func (t *TriPeaks) IsExposed(row, col int) bool

IsExposed カードが露出しているか (テスト用の公開版)

### func (*TriPeaks) IsStalemate

func (t *TriPeaks) IsStalemate() bool

IsStalemate 手詰まり状態取得

### func (*TriPeaks) MarshalJSON

func (t *TriPeaks) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*TriPeaks) Remove

func (t *TriPeaks) Remove(row, col int) error

Remove タブローのカードを除去

### func (*TriPeaks) Reset

func (t *TriPeaks) Reset()

Reset ゲームリセット

### func (*TriPeaks) SetIsStalemate

func (t *TriPeaks) SetIsStalemate(v bool)

SetIsStalemate 手詰まり状態設定 (テスト用)

### func (*TriPeaks) SetLayout

func (t *TriPeaks) SetLayout(layout [TriPeaksRowCnt][TriPeaksColCnt]*TriPeaksCard)

SetLayout レイアウト設定 (テスト用)

### func (*TriPeaks) SetPhase

func (t *TriPeaks) SetPhase(phase TriPeaksPhase)

SetPhase フェーズ設定 (テスト用)

### func (*TriPeaks) SetStock

func (t *TriPeaks) SetStock(stock []*Card)

SetStock ストック設定 (テスト用)

### func (*TriPeaks) SetWaste

func (t *TriPeaks) SetWaste(waste []*Card)

SetWaste ウェイスト設定 (テスト用)

### func (*TriPeaks) Undo

func (t *TriPeaks) Undo() error

Undo 直前の操作を取り消す

### func (*TriPeaks) UndoN

func (t *TriPeaks) UndoN(n int) error

UndoN n回連続でアンドゥを実行する。

### func (*TriPeaks) UndoToEscape

func (t *TriPeaks) UndoToEscape() int

UndoToEscape 膠着状態から抜けるために必要なアンドゥ回数を返す。膠着状態でなければ0、脱出不可なら-1。

### func (*TriPeaks) UnmarshalJSON

func (t *TriPeaks) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type TriPeaksCard

TriPeaksCard タブロー上のカード

type TriPeaksCard struct {
    Card    *Card `json:"c"`
    Removed bool  `json:"r"`
}

## type TriPeaksHint

TriPeaksHint ヒント

type TriPeaksHint struct {
    Type string // "remove" or "draw"
    Row  int
    Col  int
}

## type TriPeaksPhase

TriPeaksPhase トリピークスゲームフェーズ

type TriPeaksPhase int

TriPeaksのフェーズ定数

const (
    // TriPeaksPhasePlaying プレイ中
    TriPeaksPhasePlaying TriPeaksPhase = iota
    // TriPeaksPhaseGameClear ゲームクリア
    TriPeaksPhaseGameClear
    // TriPeaksPhaseGameOver ゲームオーバー
    TriPeaksPhaseGameOver
)

## type TrickHolder

TrickHolder トリック管理の共通構造体

type TrickHolder struct {
    // contains filtered or unexported fields
}

### func (*TrickHolder) AddTrick

func (h *TrickHolder) AddTrick(cards []*Card)

AddTrick トリックを追加

### func (*TrickHolder) GetTrickCount

func (h *TrickHolder) GetTrickCount() int

GetTrickCount 獲得したトリック数を取得

### func (*TrickHolder) GetTricksTaken

func (h *TrickHolder) GetTricksTaken() [][]*Card

GetTricksTaken 獲得したトリック一覧を取得

### func (*TrickHolder) MarshalJSON

func (h *TrickHolder) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*TrickHolder) ResetTricks

func (h *TrickHolder) ResetTricks()

ResetTricks トリックをリセット

### func (*TrickHolder) UnmarshalJSON

func (h *TrickHolder) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type TrumpCards

TrumpCards トランプカードクラス

type TrumpCards struct {
    // contains filtered or unexported fields
}

### func NewTrumpCards

func NewTrumpCards(jokerCnt int) *TrumpCards

NewTrumpCards コンストラクタ

### func NewTrumpCardsEuchre

func NewTrumpCardsEuchre() *TrumpCards

NewTrumpCardsEuchre ユーカー用24枚デッキコンストラクタ 9,10,J,Q,K,A (値: 1,9,10,11,12,13) × 4スート = 24枚

### func NewTrumpCardsPinochle

func NewTrumpCardsPinochle() *TrumpCards

NewTrumpCardsPinochle ピノクル用48枚デッキコンストラクタ 9,10,J,Q,K,A (値: 1,9,10,11,12,13) × 4スート × 2セット = 48枚

### func NewTrumpCardsShortDeck

func NewTrumpCardsShortDeck() *TrumpCards

NewTrumpCardsShortDeck ショートデック(6+)用36枚デッキコンストラクタ A,6,7,8,9,10,J,Q,K (値: 1,6,7,8,9,10,11,12,13) × 4スート = 36枚

### func NewTrumpCardsWithDecks

func NewTrumpCardsWithDecks(deckCount, jokerCnt int) *TrumpCards

NewTrumpCardsWithDecks マルチデッキ対応コンストラクタ

### func NewTrumpCardsWithSuits

func NewTrumpCardsWithSuits(totalCards int, suits []int) *TrumpCards

NewTrumpCardsWithSuits スート指定マルチデッキコンストラクタ suits で指定されたスートのみを使い、合計 totalCards 枚のデッキを作成する。 各スートの13枚をラウンドロビンで繰り返し追加し、totalCards 枚に達したら停止する。

### func (*TrumpCards) DrawCard

func (t *TrumpCards) DrawCard() *Card

DrawCard 山札配る

### func (*TrumpCards) GetRemainingCount

func (t *TrumpCards) GetRemainingCount() int

GetRemainingCount 山札の残り枚数

### func (*TrumpCards) GetTotalCount

func (t *TrumpCards) GetTotalCount() int

GetTotalCount 山札の総枚数

### func (*TrumpCards) MarshalJSON

func (t *TrumpCards) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*TrumpCards) Shuffle

func (t *TrumpCards) Shuffle()

Shuffle 山札シャッフル

### func (*TrumpCards) UnmarshalJSON

func (t *TrumpCards) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type VideoPoker

VideoPoker ビデオポーカークラス

type VideoPoker struct {
    // contains filtered or unexported fields
}

### func NewDefaultVideoPoker

func NewDefaultVideoPoker() *VideoPoker

NewDefaultVideoPoker デフォルト設定のビデオポーカー(Jacks or Better)を生成するファクトリ関数

### func NewDeucesWildVideoPoker

func NewDeucesWildVideoPoker() *VideoPoker

NewDeucesWildVideoPoker Deuces Wildバリアントを生成するファクトリ関数

### func NewJokerPokerVideoPoker

func NewJokerPokerVideoPoker() *VideoPoker

NewJokerPokerVideoPoker Joker Pokerバリアントを生成するファクトリ関数

### func NewVideoPoker

func NewVideoPoker(trumpCards *TrumpCards, config *VideoPokerVariantConfig) *VideoPoker

NewVideoPoker コンストラクタ

### func (*VideoPoker) Bet

func (vp *VideoPoker) Bet(amount int) error

Bet ベット&ディール(1〜5コイン)

### func (*VideoPoker) GetActionLog

func (vp *VideoPoker) GetActionLog() []*ActionLogEntry

GetActionLog 棋譜を取得する

### func (*VideoPoker) GetBetAmount

func (vp *VideoPoker) GetBetAmount() int

GetBetAmount ベット額

### func (*VideoPoker) GetChips

func (vp *VideoPoker) GetChips() int

GetChips チップ

### func (*VideoPoker) GetGameEndFlag

func (vp *VideoPoker) GetGameEndFlag() bool

GetGameEndFlag ゲーム終了フラグ

### func (*VideoPoker) GetHand

func (vp *VideoPoker) GetHand() []*Card

GetHand ハンド取得

### func (*VideoPoker) GetHandName

func (vp *VideoPoker) GetHandName() string

GetHandName ハンド名

### func (*VideoPoker) GetHandRank

func (vp *VideoPoker) GetHandRank() int

GetHandRank ハンドランク

### func (*VideoPoker) GetHeldIndices

func (vp *VideoPoker) GetHeldIndices() [VideoPokerHandSize]bool

GetHeldIndices ホールドインデックス

### func (*VideoPoker) GetPayout

func (vp *VideoPoker) GetPayout() int

GetPayout 配当金額

### func (*VideoPoker) GetPhase

func (vp *VideoPoker) GetPhase() int

GetPhase 現在のフェーズ

### func (*VideoPoker) GetResult

func (vp *VideoPoker) GetResult() GameResult

GetResult ゲーム結果

### func (*VideoPoker) GetVariantName

func (vp *VideoPoker) GetVariantName() string

GetVariantName バリアント名を取得する

### func (*VideoPoker) Hold

func (vp *VideoPoker) Hold(indices []int) error

Hold ホールド選択&ドロー(indicesはキープするカードの0-basedインデックス)

### func (*VideoPoker) MarshalJSON

func (vp *VideoPoker) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

### func (*VideoPoker) Reset

func (vp *VideoPoker) Reset()

Reset ゲーム初期化

### func (*VideoPoker) SetBetAmount

func (vp *VideoPoker) SetBetAmount(amount int)

SetBetAmount ベット額設定(テスト用)

### func (*VideoPoker) SetChips

func (vp *VideoPoker) SetChips(chips int)

SetChips チップ設定(テスト用)

### func (*VideoPoker) SetGameEndFlag

func (vp *VideoPoker) SetGameEndFlag(flag bool)

SetGameEndFlag ゲーム終了フラグ設定(テスト用)

### func (*VideoPoker) SetHand

func (vp *VideoPoker) SetHand(cards []*Card)

SetHand ハンド設定(テスト用)

### func (*VideoPoker) SetHandName

func (vp *VideoPoker) SetHandName(name string)

SetHandName ハンド名設定(テスト用)

### func (*VideoPoker) SetHandRank

func (vp *VideoPoker) SetHandRank(rank int)

SetHandRank ハンドランク設定(テスト用)

### func (*VideoPoker) SetHeldIndices

func (vp *VideoPoker) SetHeldIndices(held [VideoPokerHandSize]bool)

SetHeldIndices ホールドインデックス設定(テスト用)

### func (*VideoPoker) SetPayout

func (vp *VideoPoker) SetPayout(payout int)

SetPayout 配当金額設定(テスト用)

### func (*VideoPoker) SetPhase

func (vp *VideoPoker) SetPhase(phase int)

SetPhase フェーズ設定(テスト用)

### func (*VideoPoker) SetResult

func (vp *VideoPoker) SetResult(result GameResult)

SetResult ゲーム結果設定(テスト用)

### func (*VideoPoker) UnmarshalJSON

func (vp *VideoPoker) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

## type VideoPokerVariantConfig

VideoPokerVariantConfig はビデオポーカーのバリアント固有設定を保持する

type VideoPokerVariantConfig struct {
    // Name はバリアント識別子(例: "jacksorbetter", "deuceswild", "jokerpoker")
    Name string
    // JokerCount はデッキに追加するジョーカー枚数(0 or 1)
    JokerCount int
    // IsWild はカードがワイルドかどうかを判定する関数(nil = ワイルドなし)
    IsWild func(*Card) bool
    // GetResult はハンドを評価し、ランク・配当倍率・ハンド名を返す
    GetResult func(hand []*Card, betAmount int) (rank int, multiplier int, handName string)
}

### func DeucesWildConfig

func DeucesWildConfig() *VideoPokerVariantConfig

DeucesWildConfig はDeuces Wildバリアントの設定を返す

### func JacksOrBetterConfig

func JacksOrBetterConfig() *VideoPokerVariantConfig

JacksOrBetterConfig はJacks or Betterバリアントの設定を返す

### func JokerPokerConfig

func JokerPokerConfig() *VideoPokerVariantConfig

JokerPokerConfig はJoker Poker (Kings or Better)バリアントの設定を返す

## type WinnerFunc

WinnerFunc ポット勝者判定関数型

type WinnerFunc func(players []BettingPlayer, eligible []int) []int

Generated by gomarkdoc