import "github.com/yuta-yoshinaga/go_trumpcards/internal/domain"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
)const (
BJPPNone = 0 // ペアなし
BJPPMixedPair = 1 // ミックスペア(異色同数)
BJPPColoredPair = 2 // カラードペア(同色同数)
BJPPPerfectPair = 3 // パーフェクトペア(同柄同数)
)const (
BJPPMixedPairPayout = 6
BJPPColoredPairPayout = 12
BJPPPerfectPairPayout = 25
)const (
BJT3None = 0 // なし
BJT3Flush = 1 // フラッシュ
BJT3Straight = 2 // ストレート
BJT3ThreeOfAKind = 3 // スリーオブアカインド
BJT3StraightFlush = 4 // ストレートフラッシュ
BJT3SuitedTrips = 5 // スーテッドトリップス
)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 // オールイン
)const (
// NapoleonWinnerUndecided 未確定
NapoleonWinnerUndecided = -1
// NapoleonWinnerNapoleon ナポレオン軍の勝利
NapoleonWinnerNapoleon = 0
// NapoleonWinnerAllied 連合軍の勝利
NapoleonWinnerAllied = 1
)const (
OmahaPhaseInit = HoldemPhaseInit
OmahaPhasePreFlop = HoldemPhasePreFlop
OmahaPhaseFlop = HoldemPhaseFlop
OmahaPhaseTurn = HoldemPhaseTurn
OmahaPhaseRiver = HoldemPhaseRiver
OmahaPhaseShowdown = HoldemPhaseShowdown
OmahaPhaseEnd = HoldemPhaseEnd
OmahaPhaseRebuy = HoldemPhaseRebuy
)const (
OmahaActionFold = HoldemActionFold
OmahaActionCheck = HoldemActionCheck
OmahaActionCall = HoldemActionCall
OmahaActionBet = HoldemActionBet
OmahaActionRaise = HoldemActionRaise
OmahaActionAllIn = HoldemActionAllIn
)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 // フロップ後のディスカードフェーズ
)const (
PineappleActionFold = HoldemActionFold
PineappleActionCheck = HoldemActionCheck
PineappleActionCall = HoldemActionCall
PineappleActionBet = HoldemActionBet
PineappleActionRaise = HoldemActionRaise
PineappleActionAllIn = HoldemActionAllIn
)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)
)const (
SevensCpuSimple int = iota // シンプル (最初の出せるカード)
SevensCpuStrategic // 戦略的 (自己利益重視)
SevensCpuHarassment // 嫌がらせ特化 (相手妨害重視)
)const (
ShortDeckPhaseInit = HoldemPhaseInit
ShortDeckPhasePreFlop = HoldemPhasePreFlop
ShortDeckPhaseFlop = HoldemPhaseFlop
ShortDeckPhaseTurn = HoldemPhaseTurn
ShortDeckPhaseRiver = HoldemPhaseRiver
ShortDeckPhaseShowdown = HoldemPhaseShowdown
ShortDeckPhaseEnd = HoldemPhaseEnd
ShortDeckPhaseRebuy = HoldemPhaseRebuy
)const (
ShortDeckActionFold = HoldemActionFold
ShortDeckActionCheck = HoldemActionCheck
ShortDeckActionCall = HoldemActionCall
ShortDeckActionBet = HoldemActionBet
ShortDeckActionRaise = HoldemActionRaise
ShortDeckActionAllIn = HoldemActionAllIn
)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
)const BJCpuBetAmount = 50const BJMaxCpuPlayers = 3const BacPairPayoutRate = 11const BridgeHandSize = 13const BridgePlayerCnt = 4BridgeSuitNoTrump ノートランプを表すスート値
const BridgeSuitNoTrump = 0const BridgeTeamCnt = 2BridgeTotalTricks 1ラウンドの総トリック数
const BridgeTotalTricks = 13CanastaDefaultPointLimit デフォルトの目標スコア
const CanastaDefaultPointLimit = 5000CanastaHandSize 初期配布枚数 (2人制カナスタ)
const CanastaHandSize = 15const CanastaPlayerCnt = 2ClockSolitaireCardsPerPile 各パイルのカード枚数
const ClockSolitaireCardsPerPile = 4ClockSolitaireKingPileIdx 中央(K)パイルのインデックス
const ClockSolitaireKingPileIdx = 12ClockSolitairePileCount パイル数(時計の12位置+中央)
const ClockSolitairePileCount = 13const CrazyEightsHandSize = 5CrazyEightsPlayerCnt クレイジーエイトプレイヤー数
const CrazyEightsPlayerCnt = 4CrazyEightsWildValue ワイルドカード値 (8)
const CrazyEightsWildValue = 8const CribbageDealSize = 6CribbageDefaultPointLimit デフォルトのゲーム終了スコア
const CribbageDefaultPointLimit = 121const CribbageDiscardSize = 2const CribbageHandSize = 4const CribbagePegLimit = 31const CribbagePlayerCnt = 2DaifugoFiveSkipCountMax 5飛びスキップ数最大
const DaifugoFiveSkipCountMax = 5DaifugoJokerCount 大富豪で使用するジョーカー枚数
const DaifugoJokerCount = 2DaifugoJokerStrength ジョーカーの強さ (常に最強)
const DaifugoJokerStrength = 16const DaifugoPlayerCnt = 4DaifugoSolverMaxCards 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 = 8const DoubtPlayerCnt = 4const EuchreHandSize = 5const EuchreKittySize = 4const EuchrePlayerCnt = 4const EuchreTeamCnt = 2const FreeCellCellCnt = 4FreeCellFoundationCnt ファンデーションの数
const FreeCellFoundationCnt = 4FreeCellSolverMaxIterations is the maximum number of states the solver explores. Keeps runtime under ~50ms and memory under ~10MB.
const FreeCellSolverMaxIterations = 100000const FreeCellTableauCnt = 8GinRummyBigGinBonus ビッグジンボーナス点
const GinRummyBigGinBonus = 31const GinRummyGinBonus = 25const GinRummyHandSize = 10GinRummyKnockThreshold ノック可能なデッドウッド上限
const GinRummyKnockThreshold = 10const GinRummyPlayerCnt = 2GinRummyUndercutBonus アンダーカットボーナス点
const GinRummyUndercutBonus = 25GoFishBookSize ブック完成に必要な同ランク枚数
const GoFishBookSize = 4GoFishInitialHandSize 初期手札枚数 (4人以上は5枚)
const GoFishInitialHandSize = 5const GoFishPlayerCnt = 4GoFishTotalBooks ブック総数 (A-K の13種)
const GoFishTotalBooks = 13const GolfColCnt = 7const GolfRowCnt = 5GolfTableauCnt タブロー上のカード枚数 (7*5)
const GolfTableauCnt = 35const HeartsHandSize = 13HeartsMaxPoints シュート・ザ・ムーン時のペナルティ合計
const HeartsMaxPoints = 26HeartsPassCardCount パスで渡すカード枚数
const HeartsPassCardCount = 3const HeartsPlayerCnt = 4KlondikeFoundationCnt ファンデーションの数
const KlondikeFoundationCnt = 4const KlondikeTableauCnt = 7MaxClaimedValue claimed value の最大値 (K)
const MaxClaimedValue = 13MemoryBoardSize ボードのカード枚数 (52枚)
const MemoryBoardSize = 52const MemoryPlayerCnt = 4MinClaimedValue claimed value の最小値 (A)
const MinClaimedValue = 1const NapoleonHandSize = 13NapoleonMaxPictureCards 絵札の最大枚数 (J,Q,K,A × 4スート + Joker = 17)
const NapoleonMaxPictureCards = 17const NapoleonPlayerCnt = 4NapoleonTotalCards デッキ総枚数 (52 + Joker 1)
const NapoleonTotalCards = 53const OhHellPlayerCnt = 4const OldMaidPlayerCnt = 4PigsTailPlayerCnt ぶたのしっぽデフォルトプレイヤー数
const PigsTailPlayerCnt = 4const PinochleHandSize = 12PinochleLastTrickBonus 最終トリックボーナス
const PinochleLastTrickBonus = 10const PinochleMinBid = 20const PinochlePlayerCnt = 4const PinochleTeamCnt = 2PinochleTotalCardPoints ラウンドあたりの合計カードポイント (最終トリックボーナス含む)
const PinochleTotalCardPoints = 250const PokerJokerCountMax = 2PyramidCardCnt ピラミッドのカード枚数 (1+2+3+4+5+6+7)
const PyramidCardCnt = 28const PyramidRowCnt = 7const PyramidTargetSum = 13SevensMaxJokerCount 7並べで許可されるジョーカー最大枚数
const SevensMaxJokerCount = 2SevensMaxPasses 7並べで各プレイヤーに許可されるパス回数
const SevensMaxPasses = 5const SevensPlayerCnt = 4const SpadesHandSize = 13SpadesLoseThreshold 負け閾値 (-200点以下で負け)
const SpadesLoseThreshold = -200const SpadesPlayerCnt = 4const SpeedCenterPileCnt = 2const SpeedHandSize = 4SpeedPlayerCnt プレイヤー数 (human + CPU)
const SpeedPlayerCnt = 2SpiderFoundationCnt ファンデーションの数(完成スート数)
const SpiderFoundationCnt = 8const SpiderTableauCnt = 10const SpiderTotalCards = 104const TriPeaksColCnt = 10const TriPeaksRowCnt = 4TriPeaksTableauCnt タブロー上のカード枚数 (3+6+9+10)
const TriPeaksTableauCnt = 28var (
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")
)var BJValidDeckCounts = []int{1, 2, 4, 6, 8}BJValidPenetrations 有効なペネトレーション値
var BJValidPenetrations = []int{50, 75}var BettingLimitNames = []string{
"Fixed",
"Pot Limit",
"No Limit",
}DaifugoDifficultyNames 難易度名マップ
var DaifugoDifficultyNames = map[DaifugoCpuDifficulty]string{
DaifugoDifficultyNormal: "Normal",
DaifugoDifficultyEasy: "Easy",
DaifugoDifficultyHard: "Hard",
}var HoldemPlayStyleNames = []string{
"TAG",
"LAP",
"TAP",
"LAG",
"GTO",
}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",
}var PokerPlayStyleNames = []string{
"Conservative",
"Balanced",
"Aggressive",
"Bluffer",
}SevenCardStudPlayStyleNames プレイスタイル名 (Holdemと共通)
var SevenCardStudPlayStyleNames = HoldemPlayStyleNamesShortDeckHandNames ショートデックハンド名
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(resultType int) intBacPairPayout ペア結果に応じた配当倍率を返す
func CalcDeadwoodValue(deadwood []*Card) intCalcDeadwoodValue デッドウッドの合計点数を計算する
func CalcPotOdds(pot, callAmount int) float64CalcPotOdds ポットオッズを計算 (パーセンテージ 0-100)
## func CalculateBettingLimits
func CalculateBettingLimits(limit BettingLimitType, pot, lastBet int) (maxRaises, maxBetAmount int)CalculateBettingLimits ベッティングリミット設定からmaxRaisesとmaxBetAmountを計算
## func CalculateBlackJackScore
func CalculateBlackJackScore(cards []*Card) intCalculateBlackJackScore カードスライスからブラックジャックスコアを計算する共通関数
func CanastaCardValue(card *Card) intCanastaCardValue カードの点数を返す
func CanastaIsBlack3(card *Card) boolCanastaIsBlack3 黒3かどうか (スペード3またはクローバー3)
func CanastaIsRed3(card *Card) boolCanastaIsRed3 赤3かどうか (ハート3またはダイヤ3)
func CanastaIsWild(card *Card) boolCanastaIsWild ワイルドカードかどうか (ジョーカーまたは2)
func CardValueDisplayName(value int) stringCardValueDisplayName converts a card value (1-13) to its display label.
func CompareVisibleHands(a, b *SevenCardStudPlayer) intCompareVisibleHands 2人のプレイヤーの表向き札を比較する (a > b: 1, a < b: -1, a == b: 0)
func CpuCallOrCheck(callAmount int) (int, int)CpuCallOrCheck コール額がある場合はコール、なければチェック
func CpuFoldOrCheck(callAmount int) (int, int)CpuFoldOrCheck コール額がある場合はフォールド、なければチェック
func CpuRaiseOrBet(chips, callAmount, raiseAmt int) (int, int)CpuRaiseOrBet レイズまたはベット (チップ不足時はオールイン)
func CribbageScoreFifteens(cards []*Card) intCribbageScoreFifteens 15になる組み合わせを数える (各2点)
func CribbageScoreFlush(hand []*Card, starter *Card, isCrib bool) intCribbageScoreFlush フラッシュのスコアを返す hand の4枚が同一スートなら4点、starter も同じなら5点 crib の場合は5枚全て同一スートでないと0点
func CribbageScoreNobs(hand []*Card, starter *Card) intCribbageScoreNobs ノブのスコアを返す (手札のJがstarterのスートと一致 → 1点)
func CribbageScorePairs(cards []*Card) intCribbageScorePairs 同じランクのペアを数える (各2点)
func CribbageScorePegging(playedCards []*Card, pegCount int) intCribbageScorePegging ペギングのスコアを計算する playedCards は現在のペギングシーケンスで最後に追加されたカードがスコア対象
func CribbageScoreRuns(cards []*Card) intCribbageScoreRuns ランを検出してスコアを返す ランクの連続3枚以上がランとなる。重複ランクがある場合は掛け算 (ダブルラン等)
func DaifugoCardStrength(v int) intDaifugoCardStrength カードの強さを返す (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) intDaifugoCardStrengthRevolution 革命中のカードの強さを返す (2が最弱、3が最強) 2 < A(1) < K(13) < Q(12) < J(11) < 10 < 9 < 8 < 7 < 6 < 5 < 4 < 3
func DecayMemories[T MemoryEntry](memories []T, currentTurn int, decayRate float64) []TDecayMemories 古い記憶を確率的に忘却する共通関数 忘却確率 = decayRate * (currentTurn - entry.GetTurnSeen())
func DistributePots(players []BettingPlayer, sidePots []SidePot) map[int]intDistributePots サイドポットの勝者配分を計算しチップを付与
## func DistributePotsWithWinnerFunc
func DistributePotsWithWinnerFunc(players []BettingPlayer, sidePots []SidePot, winnerFunc WinnerFunc) map[int]intDistributePotsWithWinnerFunc サイドポットの勝者配分を計算しチップを付与 (勝者判定関数を指定)
func Evaluate21Plus3(card1, card2, dealerUpcard *Card) (resultType int, resultName string)Evaluate21Plus3 プレイヤーの2枚+ディーラーのアップカードで21+3を判定
func EvaluateBaccaratPair(card1, card2 *Card) (int, string)EvaluateBaccaratPair 2枚のカードがペアかを判定する
func EvaluatePerfectPairs(card1, card2 *Card) (resultType int, resultName string)EvaluatePerfectPairs プレイヤーの最初の2枚でPerfect Pairsを判定
func ExecuteBettingAction(players []BettingPlayer, state *BettingState, playerIdx, action, amount, minBetAmount, maxRaises, maxBetAmount int) errorExecuteBettingAction 共通ベッティングアクション実行 maxRaises: 最大レイズ回数 (0以下で無制限=NoLimit) maxBetAmount: 最大ベット額 (0以下で無制限)
func ExtractKickers(cards []*Card, handRank int) []intExtractKickers 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(players []BettingPlayer, eligible []int) []intFindPotWinners 対象プレイヤーから最強ハンドのプレイヤーを返す (複数ならスプリット)
func FindPotWinnersLowball(players []BettingPlayer, eligible []int) []intFindPotWinnersLowball 対象プレイヤーから最弱ハンドのプレイヤーを返す (2-7 Lowball: 低い手が勝ち) ランクが低いほど強い。同ランク時はカード値が低い方が勝つ (Ace=14 always)
func FormatKickers(kickers []int) stringFormatKickers formats kicker values as a display string (e.g., “A, Q, 10”).
func GetCountingBetAmount(trueCount float64, runningCount int, system int, availableChips int) intGetCountingBetAmount カウンティングに基づくCPUベット額を計算する ベーススプレッド: count<=1→1x, 2→2x, 3→4x, 4→8x, >=5→16x (base=BJCpuBetAmount)
func GinRummyCardValue(card *Card) intGinRummyCardValue カードの点数を返す (A=1, 2-9=face value, 10/J/Q/K=10)
## func IsBalancedCountingSystem
func IsBalancedCountingSystem(system int) boolIsBalancedCountingSystem バランスドカウンティングシステムか (TC計算可能)
func IsJoker(card *Card) boolIsJoker カードがジョーカーかどうか判定
## func IsValidHoldemTableSize
func IsValidHoldemTableSize(n int) boolIsValidHoldemTableSize テーブルサイズが有効か判定する
## func IsValidSevenCardStudTableSize
func IsValidSevenCardStudTableSize(n int) boolIsValidSevenCardStudTableSize テーブルサイズが有効か判定する
func PerfectPairsPayout(resultType int) intPerfectPairsPayout Perfect Pairsの配当倍率を返す
func ResetActedExcept(players []BettingPlayer, actedFlags []bool, exceptIdx int)ResetActedExcept 指定プレイヤー以外のactedフラグをリセット (フォールド・オールイン除く)
func ShouldTakeInsurance(trueCount float64, runningCount int, system int) boolShouldTakeInsurance カウンティングに基づきインシュランスを取るべきか判定する count >= 3 でインシュランスを取る
func SuitRank(design int) intSuitRank ブリングイン決定用のスートランキング (低い方がブリングイン) スペード=4(最高), ハート=3, ダイヤ=2, クラブ=1(最低)
func TwentyOnePlus3Payout(resultType int) intTwentyOnePlus3Payout 21+3の配当倍率を返す
func ValidateMin(name string, value, min int) errorValidateMin は値が min 以上であることを検証する。
func ValidateRange(name string, value, min, max int) errorValidateRange は値が [min, max] の範囲内であることを検証する。
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) errorUnmarshalJSON implements json.Unmarshaler.
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() stringBetTypeName ベット種別名を返す
BJSuggestedAction ベーシックストラテジー推奨アクション
type BJSuggestedAction intconst (
// 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) BJSuggestedActionGetBasicStrategyAction ベーシックストラテジーによる推奨アクションを返す (standard multi-deck, S17 or H17) H=Hit, S=Stand, D=Double(else Hit), Ds=Double(else Stand), Sp=Split, Rh=Surrender(else Hit)
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() stringBetTypeName ベット種別名を返す
Baccarat バカラクラス
type Baccarat struct {
// contains filtered or unexported fields
}func NewBaccarat(trumpCards *TrumpCards) *BaccaratNewBaccarat コンストラクタ
func NewDefaultBaccarat() *BaccaratNewDefaultBaccarat デフォルト設定のバカラを生成するファクトリ関数
func (b *Baccarat) Bet(amount, betType, ppBet, bpBet int) errorBet ベット&ゲーム実行(バカラはベット後に全自動進行)
### func (*Baccarat) CalculateHandValue
func (b *Baccarat) CalculateHandValue(cards []*Card) intCalculateHandValue ハンドの合計値を計算(mod 10)
### func (*Baccarat) ClearHistory
func (b *Baccarat) ClearHistory()ClearHistory 罫線履歴をクリアする
### func (*Baccarat) GetActionLog
func (b *Baccarat) GetActionLog() []*ActionLogEntryGetActionLog 棋譜を取得する
### func (*Baccarat) GetBankerHand
func (b *Baccarat) GetBankerHand() []*CardGetBankerHand バンカーハンド取得
### func (*Baccarat) GetBankerHandValue
func (b *Baccarat) GetBankerHandValue() intGetBankerHandValue バンカーハンド合計値
### func (*Baccarat) GetBankerPairBet
func (b *Baccarat) GetBankerPairBet() intGetBankerPairBet バンカーペアベット額を取得する
### func (*Baccarat) GetBetAmount
func (b *Baccarat) GetBetAmount() intGetBetAmount ベット額
### func (*Baccarat) GetBetType
func (b *Baccarat) GetBetType() intGetBetType ベットタイプ
func (b *Baccarat) GetChips() intGetChips チップ
### func (*Baccarat) GetGameEndFlag
func (b *Baccarat) GetGameEndFlag() boolGetGameEndFlag ゲーム終了フラグ
### func (*Baccarat) GetHistory
func (b *Baccarat) GetHistory() []intGetHistory 罫線履歴を取得する
### func (*Baccarat) GetPayout
func (b *Baccarat) GetPayout() intGetPayout 配当金額
func (b *Baccarat) GetPhase() intGetPhase 現在のフェーズ
### func (*Baccarat) GetPlayerHand
func (b *Baccarat) GetPlayerHand() []*CardGetPlayerHand プレイヤーハンド取得
### func (*Baccarat) GetPlayerHandValue
func (b *Baccarat) GetPlayerHandValue() intGetPlayerHandValue プレイヤーハンド合計値
### func (*Baccarat) GetPlayerPairBet
func (b *Baccarat) GetPlayerPairBet() intGetPlayerPairBet プレイヤーペアベット額を取得する
### func (*Baccarat) GetResult
func (b *Baccarat) GetResult() GameResultGetResult ゲーム結果
### func (*Baccarat) GetSideBetResults
func (b *Baccarat) GetSideBetResults() []*BacSideBetResultGetSideBetResults サイドベット結果を取得する
### func (*Baccarat) MarshalJSON
func (b *Baccarat) MarshalJSON() ([]byte, error)MarshalJSON implements json.Marshaler.
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 (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 (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) errorUnmarshalJSON implements json.Unmarshaler.
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() float64AdaptStrength 適応強度を返す (0.0 ~ 0.2)
### func (*BettingHumanProfile) AdjustedBluffChance
func (p *BettingHumanProfile) AdjustedBluffChance(base float64) float64AdjustedBluffChance 人間のフォールド率に基づいて調整済みブラフ確率を返す 人間がフォールドしやすい → CPUがブラフを増やす
### func (*BettingHumanProfile) AdjustedCallChance
func (p *BettingHumanProfile) AdjustedCallChance(base float64, bracket int, hesitationMs int) float64AdjustedCallChance ブラフ率と迷い時間に基づいて調整済みコール確率を返す base: ベースコール確率, bracket: ハンド強度ブラケット, hesitationMs: 迷い時間(ms)
### func (*BettingHumanProfile) BluffRate
func (p *BettingHumanProfile) BluffRate(bracket int) float64BluffRate 指定ブラケットのアグレッシブ率を返す (データなしの場合0.5)
### func (*BettingHumanProfile) Export
func (p *BettingHumanProfile) Export() BettingHumanProfileDataExport プロファイルデータをJSON永続化形式でエクスポートする
### func (*BettingHumanProfile) FoldRate
func (p *BettingHumanProfile) FoldRate() float64FoldRate フォールド率を返す (データなしの場合0.5)
### func (*BettingHumanProfile) HesitationBoost
func (p *BettingHumanProfile) HesitationBoost(ms int) float64HesitationBoost 指定msの迷い時間に対するコール確率ブーストを返す
### func (*BettingHumanProfile) HesitationStdDev
func (p *BettingHumanProfile) HesitationStdDev() float64HesitationStdDev 迷い時間の標準偏差を返す (データ不足の場合0)
### func (*BettingHumanProfile) HesitationZScore
func (p *BettingHumanProfile) HesitationZScore(ms int) float64HesitationZScore 指定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をデコードする
BettingLimitType ベッティングリミットタイプ
type BettingLimitType intconst (
// BettingLimitFixed 固定リミット (最大4回レイズ)
BettingLimitFixed BettingLimitType = iota
// BettingLimitPotLimit ポットリミット (ベット/レイズ ≤ ポット)
BettingLimitPotLimit
// BettingLimitNoLimit ノーリミット
BettingLimitNoLimit
)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
}BettingState ベッティング状態 (ポインタで渡して共有)
type BettingState struct {
Pot int
LastBet int
MinRaise int
RaiseCount int
ActedFlags []bool
}BlackJack ブラックジャッククラス
type BlackJack struct {
// contains filtered or unexported fields
}func NewBlackJack(trumpCards *TrumpCards, player *BlackJackPlayer, dealer *BlackJackPlayer) *BlackJackNewBlackJack コンストラクタ
func NewDefaultBlackJack() *BlackJackNewDefaultBlackJack デフォルト設定のブラックジャックを生成するファクトリ関数
### func (*BlackJack) CanSurrenderCpuHand
func (b *BlackJack) CanSurrenderCpuHand(cpuIdx, handIdx int) boolCanSurrenderCpuHand CPUハンドのサレンダー可否判定
### func (*BlackJack) CanSurrenderHand
func (b *BlackJack) CanSurrenderHand(handIdx int) boolCanSurrenderHand プレイヤーハンドのサレンダー可否判定
### func (*BlackJack) DealerHit
func (b *BlackJack) DealerHit()DealerHit ディーラーヒット
### func (*BlackJack) DealerStand
func (b *BlackJack) DealerStand()DealerStand ディーラースタンド
### func (*BlackJack) GameJudgment
func (b *BlackJack) GameJudgment() GameResultGameJudgment ゲーム勝敗判定(後方互換: ハンド0の結果を返す)
### func (*BlackJack) GameJudgmentForHand
func (b *BlackJack) GameJudgmentForHand(handIdx int) GameResultGameJudgmentForHand 指定ハンドの勝敗判定
### func (*BlackJack) Get21Plus3Bet
func (b *BlackJack) Get21Plus3Bet() intGet21Plus3Bet 21+3ベット額取得
### func (*BlackJack) GetActionLog
func (b *BlackJack) GetActionLog() []*ActionLogEntryGetActionLog 棋譜を取得する
### func (*BlackJack) GetBasicStrategySuggestion
func (b *BlackJack) GetBasicStrategySuggestion() BJSuggestedActionGetBasicStrategySuggestion ベーシックストラテジーによる推奨アクションを返す
### func (*BlackJack) GetConfig
func (b *BlackJack) GetConfig() BlackJackConfigGetConfig ゲーム設定取得
### func (*BlackJack) GetCpuPlayers
func (b *BlackJack) GetCpuPlayers() []*BlackJackCpuSeatGetCpuPlayers CPUプレイヤー一覧
### func (*BlackJack) GetCurrentHandIdx
func (b *BlackJack) GetCurrentHandIdx() intGetCurrentHandIdx 現在操作中のハンドインデックス
### func (*BlackJack) GetDealer
func (b *BlackJack) GetDealer() *BlackJackPlayerGetDealer ディーラー
### func (*BlackJack) GetDeckCount
func (b *BlackJack) GetDeckCount() intGetDeckCount デッキ数取得
### func (*BlackJack) GetDeckPenetration
func (b *BlackJack) GetDeckPenetration() intGetDeckPenetration デッキペネトレーション率取得
### func (*BlackJack) GetGameEndFlag
func (b *BlackJack) GetGameEndFlag() boolGetGameEndFlag ゲーム終了フラグ
### func (*BlackJack) GetInsuranceBet
func (b *BlackJack) GetInsuranceBet() intGetInsuranceBet インシュランスベット額
### func (*BlackJack) GetMultiHandCount
func (b *BlackJack) GetMultiHandCount() intGetMultiHandCount マルチハンド数取得
### func (*BlackJack) GetPerfectPairsBet
func (b *BlackJack) GetPerfectPairsBet() intGetPerfectPairsBet Perfect Pairsベット額取得
### func (*BlackJack) GetPhase
func (b *BlackJack) GetPhase() intGetPhase 現在のフェーズ
### func (*BlackJack) GetPlayer
func (b *BlackJack) GetPlayer() *BlackJackPlayerGetPlayer プレイヤー
### func (*BlackJack) GetPlayerHands
func (b *BlackJack) GetPlayerHands() []*BlackJackHandGetPlayerHands プレイヤーハンド一覧
### func (*BlackJack) GetRunningCount
func (b *BlackJack) GetRunningCount() intGetRunningCount ランニングカウント取得
### func (*BlackJack) GetSideBetResults
func (b *BlackJack) GetSideBetResults() []*BJSideBetResultGetSideBetResults サイドベット結果取得
### func (*BlackJack) GetTrueCount
func (b *BlackJack) GetTrueCount() float64GetTrueCount トゥルーカウント取得 (アンバランスドシステム(KO)では0を返す)
### func (*BlackJack) IsCountingEnabled
func (b *BlackJack) IsCountingEnabled() boolIsCountingEnabled カウンティング有効か
### func (*BlackJack) IsHintEnabled
func (b *BlackJack) IsHintEnabled() boolIsHintEnabled ヒント有効か
### func (*BlackJack) IsInsuranceAvailable
func (b *BlackJack) IsInsuranceAvailable() boolIsInsuranceAvailable インシュランス可能か
### 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) errorPlayerBet プレイヤーベット
### func (*BlackJack) PlayerDeclineEarlySurrender
func (b *BlackJack) PlayerDeclineEarlySurrender() errorPlayerDeclineEarlySurrender プレイヤーアーリーサレンダー辞退
### func (*BlackJack) PlayerDeclineInsurance
func (b *BlackJack) PlayerDeclineInsurance() errorPlayerDeclineInsurance プレイヤーインシュランス辞退
### func (*BlackJack) PlayerDoubleDown
func (b *BlackJack) PlayerDoubleDown() errorPlayerDoubleDown プレイヤーダブルダウン
### func (*BlackJack) PlayerEarlySurrender
func (b *BlackJack) PlayerEarlySurrender() errorPlayerEarlySurrender プレイヤーアーリーサレンダー
### func (*BlackJack) PlayerHit
func (b *BlackJack) PlayerHit() errorPlayerHit プレイヤーヒット
### func (*BlackJack) PlayerInsurance
func (b *BlackJack) PlayerInsurance() errorPlayerInsurance プレイヤーインシュランス
### func (*BlackJack) PlayerSplit
func (b *BlackJack) PlayerSplit() errorPlayerSplit プレイヤースプリット
### func (*BlackJack) PlayerStand
func (b *BlackJack) PlayerStand() errorPlayerStand プレイヤースタンド
### func (*BlackJack) PlayerSurrender
func (b *BlackJack) PlayerSurrender() errorPlayerSurrender プレイヤーサレンダー(ベット半額返却して降りる)
func (b *BlackJack) Reset()Reset ゲーム初期化(hintEnabled/deckCount/configは保持)
### func (*BlackJack) SetConfig
func (b *BlackJack) SetConfig(config BlackJackConfig) errorSetConfig ゲーム設定(BETフェーズのみ)
### func (*BlackJack) SetDeckCount
func (b *BlackJack) SetDeckCount(count int) errorSetDeckCount デッキ数設定(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) errorUnmarshalJSON implements json.Unmarshaler.
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() BlackJackConfigDefaultBlackJackConfig デフォルト設定 (全機能無効)
### func (BlackJackConfig) Validate
func (c BlackJackConfig) Validate() errorValidate 設定値のドメインバリデーション
BlackJackCpuSeat CPUプレイヤー席
type BlackJackCpuSeat struct {
// contains filtered or unexported fields
}func NewBlackJackCpuSeat() *BlackJackCpuSeatNewBlackJackCpuSeat コンストラクタ
### func (*BlackJackCpuSeat) GetHands
func (c *BlackJackCpuSeat) GetHands() []*BlackJackHandGetHands ハンド一覧取得
### func (*BlackJackCpuSeat) GetInsuranceBet
func (c *BlackJackCpuSeat) GetInsuranceBet() intGetInsuranceBet インシュランスベット取得
### func (*BlackJackCpuSeat) GetPlayer
func (c *BlackJackCpuSeat) GetPlayer() *BlackJackPlayerGetPlayer プレイヤー取得
### 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) errorUnmarshalJSON implements json.Unmarshaler.
BlackJackHand ブラックジャックハンド(分割対応)
type BlackJackHand struct {
// contains filtered or unexported fields
}func NewBlackJackHand() *BlackJackHandNewBlackJackHand コンストラクタ
### func (*BlackJackHand) AddCard
func (h *BlackJackHand) AddCard(card *Card)AddCard カード追加
### func (*BlackJackHand) CanSplit
func (h *BlackJackHand) CanSplit() boolCanSplit スプリット可能か(2枚でBJ値が同じ)
### func (*BlackJackHand) CanSurrender
func (h *BlackJackHand) CanSurrender() boolCanSurrender サレンダー可能か(2枚でスタンド/バースト/サレンダー前)
### func (*BlackJackHand) GetBet
func (h *BlackJackHand) GetBet() intGetBet ベット額取得
### func (*BlackJackHand) GetCard
func (h *BlackJackHand) GetCard(idx int) *CardGetCard 指定番目のカード取得
### func (*BlackJackHand) GetCards
func (h *BlackJackHand) GetCards() []*CardGetCards カード一覧取得
### func (*BlackJackHand) GetCardsSize
func (h *BlackJackHand) GetCardsSize() intGetCardsSize カード枚数取得
### func (*BlackJackHand) GetScore
func (h *BlackJackHand) GetScore() intGetScore 手札から現在のスコア計算
### func (*BlackJackHand) IsBlackJack
func (h *BlackJackHand) IsBlackJack() boolIsBlackJack ナチュラルブラックジャックか(2枚でスコア21)
### func (*BlackJackHand) IsBusted
func (h *BlackJackHand) IsBusted() boolIsBusted バーストしたか
### func (*BlackJackHand) IsDoubled
func (h *BlackJackHand) IsDoubled() boolIsDoubled ダブルダウン済みか
### func (*BlackJackHand) IsFinished
func (h *BlackJackHand) IsFinished() boolIsFinished ハンドが完了しているか
### func (*BlackJackHand) IsFromSplit
func (h *BlackJackHand) IsFromSplit() boolIsFromSplit スプリットから生じたハンドか
### func (*BlackJackHand) IsSoft
func (h *BlackJackHand) IsSoft() boolIsSoft ソフトハンド(11として有効なエースを含む)かどうか判定
### func (*BlackJackHand) IsStood
func (h *BlackJackHand) IsStood() boolIsStood スタンド済みか
### func (*BlackJackHand) IsSurrendered
func (h *BlackJackHand) IsSurrendered() boolIsSurrendered サレンダー済みか
### 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) errorUnmarshalJSON implements json.Unmarshaler.
BlackJackPlayer ブラックジャックプレイヤークラス
type BlackJackPlayer struct {
Player // 親クラス
ChipHolder // チップ管理
}func NewBlackJackPlayer() *BlackJackPlayerNewBlackJackPlayer コンストラクタ
### func (*BlackJackPlayer) GetScore
func (bp *BlackJackPlayer) GetScore() intGetScore 手札から現在のスコア計算
### func (*BlackJackPlayer) IsSoft
func (bp *BlackJackPlayer) IsSoft() boolIsSoft ソフトハンド(11として有効なエースを含む)かどうか判定
### func (*BlackJackPlayer) MarshalJSON
func (bp *BlackJackPlayer) MarshalJSON() ([]byte, error)MarshalJSON implements json.Marshaler.
### func (*BlackJackPlayer) UnmarshalJSON
func (bp *BlackJackPlayer) UnmarshalJSON(data []byte) errorUnmarshalJSON implements json.Unmarshaler.
Bridge ブリッジゲームクラス
type Bridge struct {
// contains filtered or unexported fields
}func NewBridge(trumpCards *TrumpCards, players []*BridgePlayer, config BridgeConfig) *BridgeNewBridge コンストラクタ
func (b *Bridge) CpuBid()CpuBid CPUプレイヤーがビッドする
func (b *Bridge) CpuPlay()CpuPlay CPUプレイヤーが1ターン実行
### func (*Bridge) GetActionLog
func (b *Bridge) GetActionLog() []*ActionLogEntryGetActionLog 棋譜取得
### func (*Bridge) GetBelowLine
func (b *Bridge) GetBelowLine(team int) intGetBelowLine ライン以下スコア取得
### func (*Bridge) GetBidHistory
func (b *Bridge) GetBidHistory() []*BridgeBidEntryGetBidHistory ビッド履歴取得
### func (*Bridge) GetBidPlayerIdx
func (b *Bridge) GetBidPlayerIdx() intGetBidPlayerIdx ビッドプレイヤーインデックス取得
func (b *Bridge) GetConfig() BridgeConfigGetConfig 設定取得
### func (*Bridge) GetContractLevel
func (b *Bridge) GetContractLevel() intGetContractLevel コントラクトレベル取得
### func (*Bridge) GetContractSuit
func (b *Bridge) GetContractSuit() intGetContractSuit コントラクトスート取得
### func (*Bridge) GetCurrentPlayerIdx
func (b *Bridge) GetCurrentPlayerIdx() intGetCurrentPlayerIdx 現在のプレイヤーインデックス取得
### func (*Bridge) GetCurrentTrick
func (b *Bridge) GetCurrentTrick() []*BridgeTrickCardGetCurrentTrick 現在のトリック取得
### func (*Bridge) GetDealerIdx
func (b *Bridge) GetDealerIdx() intGetDealerIdx ディーラーインデックス取得
### func (*Bridge) GetDeclarerIdx
func (b *Bridge) GetDeclarerIdx() intGetDeclarerIdx デクレアラーインデックス取得
func (b *Bridge) GetDoubled() intGetDoubled ダブル状態取得 (0=なし, 1=ダブル, 2=リダブル)
### func (*Bridge) GetDummyHand
func (b *Bridge) GetDummyHand() []*CardGetDummyHand ダミーの手札を取得 (オープニングリード後のみ公開)
### func (*Bridge) GetDummyIdx
func (b *Bridge) GetDummyIdx() intGetDummyIdx ダミーインデックス取得
### func (*Bridge) GetGameEndFlag
func (b *Bridge) GetGameEndFlag() boolGetGameEndFlag ゲーム終了フラグ取得
### func (*Bridge) GetGamesWon
func (b *Bridge) GetGamesWon(team int) intGetGamesWon 勝利ゲーム数取得
func (b *Bridge) GetHint() *BridgeHintGetHint ヒントを取得する
### func (*Bridge) GetLeadPlayerIdx
func (b *Bridge) GetLeadPlayerIdx() intGetLeadPlayerIdx リードプレイヤーインデックス取得
func (b *Bridge) GetPhase() BridgePhaseGetPhase 現在のフェーズ取得
func (b *Bridge) GetPlayer(i int) *BridgePlayerGetPlayer プレイヤー取得
### func (*Bridge) GetPlayerCnt
func (b *Bridge) GetPlayerCnt() intGetPlayerCnt プレイヤー数取得
### func (*Bridge) GetRoundNumber
func (b *Bridge) GetRoundNumber() intGetRoundNumber 現在のラウンド番号取得
### func (*Bridge) GetTeamScore
func (b *Bridge) GetTeamScore(team int) intGetTeamScore チームスコア取得
### func (*Bridge) GetTrickNumber
func (b *Bridge) GetTrickNumber() intGetTrickNumber 現在のトリック番号取得
### func (*Bridge) GetTrumpSuit
func (b *Bridge) GetTrumpSuit() intGetTrumpSuit 切り札スート取得 (-1 = NoTrump)
### func (*Bridge) GetValidPlayIndices
func (b *Bridge) GetValidPlayIndices(playerIdx int) []intGetValidPlayIndices プレイ可能なカードのインデックスリストを返す
### func (*Bridge) GetVulnerability
func (b *Bridge) GetVulnerability(team int) boolGetVulnerability バルネラビリティ取得
### func (*Bridge) GetWinnerTeam
func (b *Bridge) GetWinnerTeam() intGetWinnerTeam 勝利チーム取得 (-1 = 未確定)
### func (*Bridge) IsHumanBidTurn
func (b *Bridge) IsHumanBidTurn() boolIsHumanBidTurn 現在のビッド手番が人間かどうか
### func (*Bridge) IsHumanTurn
func (b *Bridge) IsHumanTurn() boolIsHumanTurn 現在の手番が人間かどうか
### func (*Bridge) IsOpeningLeadDone
func (b *Bridge) IsOpeningLeadDone() boolIsOpeningLeadDone オープニングリード完了か
### func (*Bridge) MarshalJSON
func (b *Bridge) MarshalJSON() ([]byte, error)MarshalJSON implements json.Marshaler.
func (b *Bridge) NextRound()NextRound 次のラウンドを開始する
func (b *Bridge) NextTrick()NextTrick 次のトリックを開始する
func (b *Bridge) PlayerBid(bidType int, level int, suit int) errorPlayerBid 人間プレイヤーがビッドする
func (b *Bridge) PlayerPlay(cardIndex int) errorPlayerPlay 人間プレイヤーがカードをプレイする
func (b *Bridge) Reset()Reset ゲーム初期化
### func (*Bridge) ResolveTrick
func (b *Bridge) ResolveTrick()ResolveTrick トリックを解決して勝者を決定する
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 (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 (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 (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) errorUnmarshalJSON implements json.Unmarshaler.
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時のみ)
}BridgeBidType ビッドの種類
type BridgeBidType intconst (
// BridgeBidPass パス
BridgeBidPass BridgeBidType = 0
// BridgeBidNormal 通常ビッド (レベル+スート)
BridgeBidNormal BridgeBidType = 1
// BridgeBidDouble ダブル
BridgeBidDouble BridgeBidType = 2
// BridgeBidRedouble リダブル
BridgeBidRedouble BridgeBidType = 3
)BridgeConfig ブリッジゲーム設定
type BridgeConfig struct {
CpuDifficulty BridgeCpuDifficulty `json:"cd"`
}func DefaultBridgeConfig() BridgeConfigDefaultBridgeConfig デフォルト設定を返す
### func (BridgeConfig) Validate
func (c BridgeConfig) Validate() errorValidate 設定値のドメインバリデーション
BridgeCpuDifficulty CPU の難易度レベル
type BridgeCpuDifficulty intconst (
// BridgeCpuDifficultyEasy 低難易度 (ランダムビッド・プレイ)
BridgeCpuDifficultyEasy BridgeCpuDifficulty = iota
// BridgeCpuDifficultyNormal 中難易度 (ポイントカウント制ビッド)
BridgeCpuDifficultyNormal
// BridgeCpuDifficultyHard 高難易度 (戦略的プレイ)
BridgeCpuDifficultyHard
)BridgeHint ヒント情報
type BridgeHint struct {
CardIndex *int // 推奨カードインデックス (プレイ時)
BidType *int // 推奨ビッド種類
BidLevel *int // 推奨ビッドレベル
BidSuit *int // 推奨ビッドスート
Reason string // ヒント理由キー
}BridgePhase ゲームフェーズ
type BridgePhase intconst (
// BridgePhaseBid オークション(ビッド)フェーズ
BridgePhaseBid BridgePhase = 0
// BridgePhasePlay トリックプレイフェーズ
BridgePhasePlay BridgePhase = 1
// BridgePhaseTrickEnd トリック終了フェーズ
BridgePhaseTrickEnd BridgePhase = 2
// BridgePhaseRoundEnd ラウンド終了フェーズ
BridgePhaseRoundEnd BridgePhase = 3
// BridgePhaseGameEnd ゲーム終了フェーズ
BridgePhaseGameEnd BridgePhase = 4
)BridgePlayer ブリッジプレイヤークラス
type BridgePlayer struct {
*GamePlayer
TrickHolder
// contains filtered or unexported fields
}func NewBridgePlayer(isHuman bool, team int) *BridgePlayerNewBridgePlayer コンストラクタ
### func (*BridgePlayer) GetTeam
func (p *BridgePlayer) GetTeam() intGetTeam チームインデックスを取得
### 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) errorUnmarshalJSON implements json.Unmarshaler.
BridgeTrickCard トリック中の1枚
type BridgeTrickCard struct {
PlayerIdx int `json:"pi"`
Card *Card `json:"c"`
}Canasta カナスタゲームクラス
type Canasta struct {
// contains filtered or unexported fields
}func NewCanasta(trumpCards *TrumpCards, players []*CanastaPlayer, config CanastaConfig) *CanastaNewCanasta コンストラクタ
func (g *Canasta) CpuPlay()CpuPlay 現在の手番がCPUの場合にターンを実行
### func (*Canasta) GetActionLog
func (g *Canasta) GetActionLog() []*ActionLogEntryGetActionLog 棋譜取得
func (g *Canasta) GetConfig() CanastaConfigGetConfig 設定取得
### func (*Canasta) GetCurrentPlayerIdx
func (g *Canasta) GetCurrentPlayerIdx() intGetCurrentPlayerIdx 現在のプレイヤーインデックス取得
### func (*Canasta) GetDiscardPile
func (g *Canasta) GetDiscardPile() []*CardGetDiscardPile 捨て札の山を取得
### func (*Canasta) GetDiscardPileCount
func (g *Canasta) GetDiscardPileCount() intGetDiscardPileCount 捨て札の枚数取得
### func (*Canasta) GetDiscardTop
func (g *Canasta) GetDiscardTop() *CardGetDiscardTop 捨て札の一番上を取得
### func (*Canasta) GetDrawPileCount
func (g *Canasta) GetDrawPileCount() intGetDrawPileCount 山札の残り枚数取得
### func (*Canasta) GetDrewFromDiscard
func (g *Canasta) GetDrewFromDiscard() boolGetDrewFromDiscard 捨て札から引いたか取得
### func (*Canasta) GetGameEndFlag
func (g *Canasta) GetGameEndFlag() boolGetGameEndFlag ゲーム終了フラグ取得
### func (*Canasta) GetIsFrozen
func (g *Canasta) GetIsFrozen() boolGetIsFrozen 捨て札の山がフリーズ状態か取得
func (g *Canasta) GetPhase() CanastaPhaseGetPhase 現在のフェーズ取得
func (g *Canasta) GetPlayer(i int) *CanastaPlayerGetPlayer プレイヤー取得
### func (*Canasta) GetPlayerCnt
func (g *Canasta) GetPlayerCnt() intGetPlayerCnt プレイヤー数取得
### func (*Canasta) GetRoundNumber
func (g *Canasta) GetRoundNumber() intGetRoundNumber 現在のラウンド番号取得
### func (*Canasta) GetWinnerIdx
func (g *Canasta) GetWinnerIdx() intGetWinnerIdx 勝者インデックス取得 (-1 = 未確定)
### func (*Canasta) IsHumanTurn
func (g *Canasta) IsHumanTurn() boolIsHumanTurn 現在の手番が人間かどうか
### func (*Canasta) MarshalJSON
func (g *Canasta) MarshalJSON() ([]byte, error)MarshalJSON implements json.Marshaler.
func (g *Canasta) NextRound()NextRound 次のラウンドを開始する
### func (*Canasta) PlayerDiscard
func (g *Canasta) PlayerDiscard(cardIndex int) errorPlayerDiscard 人間プレイヤーがカードを捨てる
### func (*Canasta) PlayerDrawFromDiscard
func (g *Canasta) PlayerDrawFromDiscard(naturalPairIndices []int) errorPlayerDrawFromDiscard 人間プレイヤーが捨て札の山を取る
### func (*Canasta) PlayerDrawFromStock
func (g *Canasta) PlayerDrawFromStock() errorPlayerDrawFromStock 人間プレイヤーが山札からカードを引く
### func (*Canasta) PlayerGoOut
func (g *Canasta) PlayerGoOut() errorPlayerGoOut 人間プレイヤーが上がる
### func (*Canasta) PlayerMeld
func (g *Canasta) PlayerMeld(meldGroups [][]int) errorPlayerMeld 人間プレイヤーがメルドを出す
### func (*Canasta) PlayerSkipMeld
func (g *Canasta) PlayerSkipMeld() errorPlayerSkipMeld メルドフェーズをスキップする
func (g *Canasta) Reset()Reset ゲーム初期化
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 (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) errorUnmarshalJSON implements json.Unmarshaler.
CanastaConfig カナスタゲーム設定
type CanastaConfig struct {
CpuDifficulty CanastaCpuDifficulty `json:"cd"`
PointLimit int `json:"pl"` // ゲーム終了スコア (先に到達したプレイヤーが勝利)
}func DefaultCanastaConfig() CanastaConfigDefaultCanastaConfig デフォルト設定を返す
### func (CanastaConfig) Validate
func (c CanastaConfig) Validate() errorValidate 設定値のドメインバリデーション
CanastaCpuDifficulty CPU の難易度レベル
type CanastaCpuDifficulty intconst (
// CanastaCpuDifficultyEasy 低難易度
CanastaCpuDifficultyEasy CanastaCpuDifficulty = iota
// CanastaCpuDifficultyNormal 中難易度
CanastaCpuDifficultyNormal
// CanastaCpuDifficultyHard 高難易度
CanastaCpuDifficultyHard
)CanastaMeld テーブル上のメルド
type CanastaMeld struct {
Cards []*Card `json:"ca"`
IsNatural bool `json:"in"` // ワイルドカードを含まない場合 true
}### func (*CanastaMeld) GetRank
func (m *CanastaMeld) GetRank() intGetRank メルドのランク(ナチュラルカードのランク)を返す
### func (*CanastaMeld) IsCanasta
func (m *CanastaMeld) IsCanasta() boolIsCanasta 7枚以上のメルドかどうか
CanastaPhase ゲームフェーズ
type CanastaPhase intconst (
// CanastaPhaseDraw ドローフェーズ (山札または捨て札から引く)
CanastaPhaseDraw CanastaPhase = 0
// CanastaPhaseMeld メルドフェーズ (メルドを出す/既存メルドに追加する)
CanastaPhaseMeld CanastaPhase = 1
// CanastaPhaseDiscard ディスカードフェーズ (手札から1枚捨てる or 上がる)
CanastaPhaseDiscard CanastaPhase = 2
// CanastaPhaseRoundEnd ラウンド終了フェーズ
CanastaPhaseRoundEnd CanastaPhase = 3
// CanastaPhaseGameEnd ゲーム終了フェーズ
CanastaPhaseGameEnd CanastaPhase = 4
)CanastaPlayer カナスタプレイヤークラス
type CanastaPlayer struct {
*GamePlayer
RoundScoreHolder
// contains filtered or unexported fields
}func NewCanastaPlayer(isHuman bool) *CanastaPlayerNewCanastaPlayer コンストラクタ
### 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() boolGetHasInitMeld 初回メルド済みフラグ取得
### func (*CanastaPlayer) GetMelds
func (p *CanastaPlayer) GetMelds() []*CanastaMeldGetMelds メルドを取得
### func (*CanastaPlayer) GetRed3s
func (p *CanastaPlayer) GetRed3s() []*CardGetRed3s 赤3を取得
### func (*CanastaPlayer) HasCanasta
func (p *CanastaPlayer) HasCanasta() boolHasCanasta カナスタ(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) errorUnmarshalJSON implements json.Unmarshaler.
Card カードクラス
type Card struct {
// contains filtered or unexported fields
}func FindBestMelds(cards []*Card) (melds [][]*Card, deadwood []*Card)FindBestMelds カードの最適なメルド分割を見つける (デッドウッドを最小化)
func NewCard(design int, value int, draw bool) *CardNewCard コンストラクタ
func (c *Card) GetDesign() intGetDesign カード種類取得
func (c *Card) GetDraw() boolGetDraw カード払い出しフラグ取得
func (c *Card) GetValue() intGetValue カード値取得
func (c *Card) MarshalJSON() ([]byte, error)MarshalJSON implements json.Marshaler.
func (c *Card) SetDraw(draw bool)SetDraw カード払い出しフラグ設定
### func (*Card) UnmarshalJSON
func (c *Card) UnmarshalJSON(data []byte) errorUnmarshalJSON implements json.Unmarshaler.
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() intGetChips チップ取得
### 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) boolSubtractChips チップ減算 (不足時はfalseを返す)
### func (*ChipHolder) UnmarshalJSON
func (ch *ChipHolder) UnmarshalJSON(data []byte) errorUnmarshalJSON implements json.Unmarshaler.
ClockSolitaire クロックソリティアゲームクラス
type ClockSolitaire struct {
// contains filtered or unexported fields
}func NewClockSolitaire(trumpCards *TrumpCards) *ClockSolitaireNewClockSolitaire コンストラクタ
### func (*ClockSolitaire) AutoPlay
func (cs *ClockSolitaire) AutoPlay() errorAutoPlay 自動プレイ(全ステップ実行)
### func (*ClockSolitaire) GetActionLog
func (cs *ClockSolitaire) GetActionLog() []*ActionLogEntryGetActionLog 棋譜取得
### func (*ClockSolitaire) GetCurrentCard
func (cs *ClockSolitaire) GetCurrentCard() *CardGetCurrentCard 現在のカード取得
### func (*ClockSolitaire) GetFaceUpCount
func (cs *ClockSolitaire) GetFaceUpCount() [ClockSolitairePileCount]intGetFaceUpCount 表向き枚数取得
### func (*ClockSolitaire) GetPhase
func (cs *ClockSolitaire) GetPhase() ClockSolitairePhaseGetPhase フェーズ取得
### func (*ClockSolitaire) GetPiles
func (cs *ClockSolitaire) GetPiles() [ClockSolitairePileCount][]*ClockSolitaireCardGetPiles パイル取得
### func (*ClockSolitaire) GetStepCount
func (cs *ClockSolitaire) GetStepCount() intGetStepCount ステップ数取得
### 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() errorStep 1ステップ実行
### func (*ClockSolitaire) UnmarshalJSON
func (cs *ClockSolitaire) UnmarshalJSON(data []byte) errorUnmarshalJSON implements json.Unmarshaler.
ClockSolitaireCard パイル上のカード
type ClockSolitaireCard struct {
Card *Card `json:"c"`
FaceUp bool `json:"f"`
}ClockSolitairePhase クロックソリティアゲームフェーズ
type ClockSolitairePhase intconst (
// ClockSolitairePhasePlaying プレイ中
ClockSolitairePhasePlaying ClockSolitairePhase = iota
// ClockSolitairePhaseGameClear ゲームクリア
ClockSolitairePhaseGameClear
// ClockSolitairePhaseGameOver ゲームオーバー
ClockSolitairePhaseGameOver
)CrazyEights クレイジーエイトゲームクラス
type CrazyEights struct {
// contains filtered or unexported fields
}func NewCrazyEights(trumpCards *TrumpCards, players []*CrazyEightsPlayer, config CrazyEightsConfig) *CrazyEightsNewCrazyEights コンストラクタ
### 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() []*ActionLogEntryGetActionLog 棋譜取得
### func (*CrazyEights) GetChosenSuit
func (g *CrazyEights) GetChosenSuit() intGetChosenSuit 選択されたスート取得 (-1 = 未選択)
### func (*CrazyEights) GetConfig
func (g *CrazyEights) GetConfig() CrazyEightsConfigGetConfig 設定取得
### func (*CrazyEights) GetCurrentPlayerIdx
func (g *CrazyEights) GetCurrentPlayerIdx() intGetCurrentPlayerIdx 現在のプレイヤーインデックス取得
### func (*CrazyEights) GetDiscardPile
func (g *CrazyEights) GetDiscardPile() []*CardGetDiscardPile 捨て札の山を取得
### func (*CrazyEights) GetDiscardTop
func (g *CrazyEights) GetDiscardTop() *CardGetDiscardTop 捨て札の一番上を取得
### func (*CrazyEights) GetDrawPileCount
func (g *CrazyEights) GetDrawPileCount() intGetDrawPileCount 山札の残り枚数取得
### func (*CrazyEights) GetGameEndFlag
func (g *CrazyEights) GetGameEndFlag() boolGetGameEndFlag ゲーム終了フラグ取得
### func (*CrazyEights) GetPhase
func (g *CrazyEights) GetPhase() CrazyEightsPhaseGetPhase 現在のフェーズ取得
### func (*CrazyEights) GetPlayer
func (g *CrazyEights) GetPlayer(i int) *CrazyEightsPlayerGetPlayer プレイヤー取得
### func (*CrazyEights) GetPlayerCnt
func (g *CrazyEights) GetPlayerCnt() intGetPlayerCnt プレイヤー数取得
### func (*CrazyEights) GetRoundNumber
func (g *CrazyEights) GetRoundNumber() intGetRoundNumber 現在のラウンド番号取得
### func (*CrazyEights) GetValidPlayIndices
func (g *CrazyEights) GetValidPlayIndices(playerIdx int) []intGetValidPlayIndices プレイ可能なカードのインデックスリストを返す (Web用)
### func (*CrazyEights) GetWinnerIdx
func (g *CrazyEights) GetWinnerIdx() intGetWinnerIdx 勝者インデックス取得 (-1 = 未確定)
### func (*CrazyEights) IsHumanTurn
func (g *CrazyEights) IsHumanTurn() boolIsHumanTurn 現在の手番が人間かどうか
### 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) errorPlayerChooseSuit 人間プレイヤーがスートを選択する (8を出した後)
### func (*CrazyEights) PlayerDraw
func (g *CrazyEights) PlayerDraw() errorPlayerDraw 人間プレイヤーがカードを引く
### func (*CrazyEights) PlayerPlay
func (g *CrazyEights) PlayerPlay(cardIndex int) errorPlayerPlay 人間プレイヤーがカードをプレイする
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) errorUnmarshalJSON implements json.Unmarshaler.
CrazyEightsConfig クレイジーエイトゲーム設定
type CrazyEightsConfig struct {
CpuDifficulty CrazyEightsCpuDifficulty `json:"cd"`
PointLimit int `json:"pl"` // ゲーム終了スコア (先に到達したプレイヤーが勝利)
}### func DefaultCrazyEightsConfig
func DefaultCrazyEightsConfig() CrazyEightsConfigDefaultCrazyEightsConfig デフォルト設定を返す
### func (CrazyEightsConfig) Validate
func (c CrazyEightsConfig) Validate() errorValidate 設定値のドメインバリデーション
## type CrazyEightsCpuDifficulty
CrazyEightsCpuDifficulty CPU の難易度レベル
type CrazyEightsCpuDifficulty intconst (
// CrazyEightsCpuDifficultyEasy 低難易度
CrazyEightsCpuDifficultyEasy CrazyEightsCpuDifficulty = iota
// CrazyEightsCpuDifficultyNormal 中難易度
CrazyEightsCpuDifficultyNormal
// CrazyEightsCpuDifficultyHard 高難易度
CrazyEightsCpuDifficultyHard
)CrazyEightsPhase ゲームフェーズ
type CrazyEightsPhase intconst (
// CrazyEightsPhasePlay 通常プレイフェーズ
CrazyEightsPhasePlay CrazyEightsPhase = 0
// CrazyEightsPhaseChooseSuit 8を出した後のスート選択フェーズ
CrazyEightsPhaseChooseSuit CrazyEightsPhase = 1
// CrazyEightsPhaseRoundEnd ラウンド終了フェーズ
CrazyEightsPhaseRoundEnd CrazyEightsPhase = 2
// CrazyEightsPhaseGameEnd ゲーム終了フェーズ
CrazyEightsPhaseGameEnd CrazyEightsPhase = 3
)CrazyEightsPlayer クレイジーエイトプレイヤークラス
type CrazyEightsPlayer struct {
*GamePlayer
RoundScoreHolder
}func NewCrazyEightsPlayer(isHuman bool) *CrazyEightsPlayerNewCrazyEightsPlayer コンストラクタ
### 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) errorUnmarshalJSON implements json.Unmarshaler.
Cribbage クリベッジゲームクラス
type Cribbage struct {
// contains filtered or unexported fields
}func NewCribbage(trumpCards *TrumpCards, players []*CribbagePlayer, config CribbageConfig) *CribbageNewCribbage コンストラクタ
func (g *Cribbage) CpuPlay()CpuPlay CPUのターンを自動実行
### func (*Cribbage) GetActionLog
func (g *Cribbage) GetActionLog() []*ActionLogEntryGetActionLog アクションログ取得
### func (*Cribbage) GetConfig
func (g *Cribbage) GetConfig() CribbageConfigGetConfig 設定取得
func (g *Cribbage) GetCrib() []*CardGetCrib クリブ取得
### func (*Cribbage) GetCurrentPlayerIdx
func (g *Cribbage) GetCurrentPlayerIdx() intGetCurrentPlayerIdx 現在のプレイヤーインデックス取得
### func (*Cribbage) GetDealerIdx
func (g *Cribbage) GetDealerIdx() intGetDealerIdx ディーラーインデックス取得
### func (*Cribbage) GetGameEndFlag
func (g *Cribbage) GetGameEndFlag() boolGetGameEndFlag ゲーム終了フラグ取得
### func (*Cribbage) GetHandScoreDetails
func (g *Cribbage) GetHandScoreDetails() [3]*CribbageScoreDetailGetHandScoreDetails ハンドスコア詳細取得
### func (*Cribbage) GetOriginalHand
func (g *Cribbage) GetOriginalHand(playerIdx int) []*CardGetOriginalHand ショーフェーズ用の元の手札を取得
### func (*Cribbage) GetPegCount
func (g *Cribbage) GetPegCount() intGetPegCount ペギングカウント取得
### func (*Cribbage) GetPegPlayedCards
func (g *Cribbage) GetPegPlayedCards() []*CardGetPegPlayedCards ペギングで出されたカード取得
func (g *Cribbage) GetPhase() CribbagePhaseGetPhase フェーズ取得
### func (*Cribbage) GetPlayer
func (g *Cribbage) GetPlayer(idx int) *CribbagePlayerGetPlayer プレイヤー取得
### func (*Cribbage) GetPlayerPeggedCards
func (g *Cribbage) GetPlayerPeggedCards(playerIdx int) []*CardGetPlayerPeggedCards プレイヤーがペギングで出したカードを取得
### func (*Cribbage) GetRoundNumber
func (g *Cribbage) GetRoundNumber() intGetRoundNumber ラウンド番号取得
### func (*Cribbage) GetShowPhaseStep
func (g *Cribbage) GetShowPhaseStep() intGetShowPhaseStep ショーフェーズのステップ取得
### func (*Cribbage) GetStarter
func (g *Cribbage) GetStarter() *CardGetStarter スターターカード取得
### func (*Cribbage) GetWinnerIdx
func (g *Cribbage) GetWinnerIdx() intGetWinnerIdx 勝者インデックス取得
### func (*Cribbage) IsHumanTurn
func (g *Cribbage) IsHumanTurn() boolIsHumanTurn 人間のターンかどうか
### 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) errorPlayerDiscard 人間プレイヤーがクリブに2枚捨てる
func (g *Cribbage) PlayerGo() errorPlayerGo 人間プレイヤーがGoを宣言
### func (*Cribbage) PlayerPeg
func (g *Cribbage) PlayerPeg(cardIndex int) errorPlayerPeg 人間プレイヤーがペギングでカードを出す
func (g *Cribbage) Reset()Reset ゲーム初期化
### func (*Cribbage) SetConfig
func (g *Cribbage) SetConfig(config CribbageConfig)SetConfig 設定変更
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 (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 (g *Cribbage) ShowNext() errorShowNext ショーフェーズの次のスコア計算を実行
### func (*Cribbage) UnmarshalJSON
func (g *Cribbage) UnmarshalJSON(data []byte) errorUnmarshalJSON implements json.Unmarshaler.
CribbageConfig クリベッジゲーム設定
type CribbageConfig struct {
CpuDifficulty CribbageCpuDifficulty
PointLimit int // ゲーム終了スコア (先に到達したプレイヤーが勝利、デフォルト121)
}### func DefaultCribbageConfig
func DefaultCribbageConfig() CribbageConfigDefaultCribbageConfig デフォルト設定を返す
### func (CribbageConfig) MarshalJSON
func (c CribbageConfig) MarshalJSON() ([]byte, error)MarshalJSON implements json.Marshaler.
### func (*CribbageConfig) UnmarshalJSON
func (c *CribbageConfig) UnmarshalJSON(data []byte) errorUnmarshalJSON implements json.Unmarshaler.
### func (CribbageConfig) Validate
func (c CribbageConfig) Validate() errorValidate 設定値のドメインバリデーション
CribbageCpuDifficulty CPU の難易度レベル
type CribbageCpuDifficulty intconst (
// CribbageCpuDifficultyEasy 低難易度
CribbageCpuDifficultyEasy CribbageCpuDifficulty = iota
// CribbageCpuDifficultyNormal 中難易度
CribbageCpuDifficultyNormal
// CribbageCpuDifficultyHard 高難易度
CribbageCpuDifficultyHard
)CribbagePhase ゲームフェーズ
type CribbagePhase intconst (
// 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
)CribbagePlayer クリベッジプレイヤークラス
type CribbagePlayer struct {
*GamePlayer
RoundScoreHolder
}func NewCribbagePlayer(isHuman bool) *CribbagePlayerNewCribbagePlayer コンストラクタ
### 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) errorUnmarshalJSON implements json.Unmarshaler.
CribbageScoreDetail クリベッジのスコア内訳
type CribbageScoreDetail struct {
Fifteens int
Pairs int
Runs int
Flush int
Nobs int
Total int
Cards []*Card // スコア対象カード (hand + starter)
}func CribbageScoreHand(hand []*Card, starter *Card, isCrib bool) CribbageScoreDetailCribbageScoreHand ハンド全体のスコアを計算する
### func (CribbageScoreDetail) MarshalJSON
func (d CribbageScoreDetail) MarshalJSON() ([]byte, error)MarshalJSON implements json.Marshaler.
### func (*CribbageScoreDetail) UnmarshalJSON
func (d *CribbageScoreDetail) UnmarshalJSON(data []byte) errorUnmarshalJSON implements json.Unmarshaler.
Daifugo 大富豪ゲームクラス
type Daifugo struct {
// contains filtered or unexported fields
}func NewDaifugo(trumpCards *TrumpCards, players []*DaifugoPlayer, config DaifugoConfig) *DaifugoNewDaifugo コンストラクタ
func (d *Daifugo) CpuPlay()CpuPlay 現在の手番がCPUの場合に1ターン実行
### func (*Daifugo) GetActionLog
func (d *Daifugo) GetActionLog() []*ActionLogEntryGetActionLog 棋譜を取得する
func (d *Daifugo) GetConfig() DaifugoConfigGetConfig ローカルルール設定取得
### func (*Daifugo) GetCpuActions
func (d *Daifugo) GetCpuActions() []*DaifugoCpuActionGetCpuActions CPUターンの行動履歴取得
### func (*Daifugo) GetCurrentTurn
func (d *Daifugo) GetCurrentTurn() intGetCurrentTurn 現在の手番プレイヤーインデックス取得
### func (*Daifugo) GetElevenBackActive
func (d *Daifugo) GetElevenBackActive() boolGetElevenBackActive 11バック発動中か取得
### func (*Daifugo) GetExchangeActions
func (d *Daifugo) GetExchangeActions() []*DaifugoExchangeActionGetExchangeActions カード交換記録取得
### func (*Daifugo) GetGameEndFlag
func (d *Daifugo) GetGameEndFlag() boolGetGameEndFlag ゲーム終了フラグ取得
### func (*Daifugo) GetHumanAction
func (d *Daifugo) GetHumanAction() *DaifugoCpuActionGetHumanAction 人間の最後の行動取得
### func (*Daifugo) GetLastPlayPlayerIdx
func (d *Daifugo) GetLastPlayPlayerIdx() intGetLastPlayPlayerIdx 最後にカードを出したプレイヤーインデックス取得 (-1 = なし)
### func (*Daifugo) GetLockedSuit
func (d *Daifugo) GetLockedSuit() intGetLockedSuit 縛られているスート取得
### func (*Daifugo) GetNumberLocked
func (d *Daifugo) GetNumberLocked() boolGetNumberLocked 連番縛り発動中か取得
### func (*Daifugo) GetPassCount
func (d *Daifugo) GetPassCount() intGetPassCount 現在のパスカウント取得
### func (*Daifugo) GetPendingActionTarget
func (d *Daifugo) GetPendingActionTarget() intGetPendingActionTarget ペンディングアクションの対象プレイヤーインデックス取得
### func (*Daifugo) GetPendingActionType
func (d *Daifugo) GetPendingActionType() DaifugoPendingActionGetPendingActionType ペンディングアクションの種類取得
func (d *Daifugo) GetPlayer(idx int) *DaifugoPlayerGetPlayer プレイヤー取得
### func (*Daifugo) GetPlayerCnt
func (d *Daifugo) GetPlayerCnt() intGetPlayerCnt プレイヤー数取得
### func (*Daifugo) GetReverseDirection
func (d *Daifugo) GetReverseDirection() boolGetReverseDirection 9リバースの方向取得
### func (*Daifugo) GetRevolutionActive
func (d *Daifugo) GetRevolutionActive() boolGetRevolutionActive 革命フラグ取得
### func (*Daifugo) GetSequenceLocked
func (d *Daifugo) GetSequenceLocked() boolGetSequenceLocked 階段縛り発動中か取得
### func (*Daifugo) GetSortMode
func (d *Daifugo) GetSortMode() DaifugoSortModeGetSortMode 手札ソートモード取得
### func (*Daifugo) GetSuitLocked
func (d *Daifugo) GetSuitLocked() boolGetSuitLocked スート縛り発動中か取得
### func (*Daifugo) GetTableCards
func (d *Daifugo) GetTableCards() []*CardGetTableCards 場のカード取得 (nil = クリア)
### func (*Daifugo) GetTableIsSequence
func (d *Daifugo) GetTableIsSequence() boolGetTableIsSequence 場が階段プレイか取得
### func (*Daifugo) HasPendingAction
func (d *Daifugo) HasPendingAction() boolHasPendingAction ペンディングアクションがあるか取得
### func (*Daifugo) IsHumanTurn
func (d *Daifugo) IsHumanTurn() boolIsHumanTurn 現在の手番が人間かどうか
### func (*Daifugo) MarshalJSON
func (d *Daifugo) MarshalJSON() ([]byte, error)MarshalJSON implements json.Marshaler.
### func (*Daifugo) PlayerPlay
func (d *Daifugo) PlayerPlay(indices []int) errorPlayerPlay 人間プレイヤーがカードを出す (または パスする) indices: 出すカードのインデックス。空の場合はパス。
func (d *Daifugo) Reset()Reset ゲーム初期化
func (d *Daifugo) SetConfig(config DaifugoConfig)SetConfig ローカルルール設定を変更(ResetWithConfig用)
### func (*Daifugo) SortHumanHand
func (d *Daifugo) SortHumanHand(mode DaifugoSortMode) errorSortHumanHand 人間プレイヤーの手札を指定モードでソートする
### func (*Daifugo) UnmarshalJSON
func (d *Daifugo) UnmarshalJSON(data []byte) errorUnmarshalJSON implements json.Unmarshaler.
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() DaifugoConfigDefaultDaifugoConfig デフォルトのローカルルール設定 (全て有効)
### func (DaifugoConfig) MarshalJSON
func (c DaifugoConfig) MarshalJSON() ([]byte, error)MarshalJSON implements json.Marshaler.
### func (*DaifugoConfig) UnmarshalJSON
func (c *DaifugoConfig) UnmarshalJSON(data []byte) errorUnmarshalJSON implements json.Unmarshaler.
### func (DaifugoConfig) Validate
func (c DaifugoConfig) Validate() errorValidate 設定値のドメインバリデーション
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) errorUnmarshalJSON implements json.Unmarshaler.
DaifugoCpuDifficulty CPU難易度レベル
type DaifugoCpuDifficulty intconst (
// DaifugoDifficultyNormal 通常難易度 (デフォルト)
DaifugoDifficultyNormal DaifugoCpuDifficulty = 0
// DaifugoDifficultyEasy 簡単 (単純なグリーディ)
DaifugoDifficultyEasy DaifugoCpuDifficulty = 1
// DaifugoDifficultyHard 難しい (ヒューリスティックAI)
DaifugoDifficultyHard DaifugoCpuDifficulty = 2
)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) errorUnmarshalJSON implements json.Unmarshaler.
DaifugoPendingAction ペンディングアクションの種類
type DaifugoPendingAction intconst (
// DaifugoPendingNone ペンディングなし
DaifugoPendingNone DaifugoPendingAction = 0
// DaifugoPendingSevenPass 7渡し待ち
DaifugoPendingSevenPass DaifugoPendingAction = 1
// DaifugoPendingTenDiscard 10捨て待ち
DaifugoPendingTenDiscard DaifugoPendingAction = 2
// DaifugoPendingQueenBomber 12ボンバー待ち
DaifugoPendingQueenBomber DaifugoPendingAction = 3
)DaifugoPlayer 大富豪プレイヤークラス
type DaifugoPlayer struct {
*RankedGamePlayer
// contains filtered or unexported fields
}func NewDaifugoPlayer(isHuman bool) *DaifugoPlayerNewDaifugoPlayer コンストラクタ
### func (*DaifugoPlayer) CountCardsByValue
func (p *DaifugoPlayer) CountCardsByValue(value int) intCountCardsByValue 指定した値のカードの枚数を返す
### func (*DaifugoPlayer) GetIllegalFinishPenalty
func (p *DaifugoPlayer) GetIllegalFinishPenalty() boolGetIllegalFinishPenalty 反則上がりペナルティ取得
### func (*DaifugoPlayer) GetPrevRank
func (p *DaifugoPlayer) GetPrevRank() intGetPrevRank 前回のランク取得 (-1 = なし)
### func (*DaifugoPlayer) MarshalJSON
func (p *DaifugoPlayer) MarshalJSON() ([]byte, error)MarshalJSON implements json.Marshaler.
### func (*DaifugoPlayer) RemoveCardsByValue
func (p *DaifugoPlayer) RemoveCardsByValue(value int) []*CardRemoveCardsByValue 指定した値のカードを全て除去して返す
### 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) errorUnmarshalJSON implements json.Unmarshaler.
DaifugoSortMode 手札ソートモード
type DaifugoSortMode intconst (
// DaifugoSortByStrength 強さ順 (デフォルト)
DaifugoSortByStrength DaifugoSortMode = 0
// DaifugoSortBySuit スート順
DaifugoSortBySuit DaifugoSortMode = 1
// DaifugoSortByNumber 数字順
DaifugoSortByNumber DaifugoSortMode = 2
)DaifugoSuitLockMode スート縛りモード
type DaifugoSuitLockMode intconst (
// DaifugoSuitLockNone スート縛りなし
DaifugoSuitLockNone DaifugoSuitLockMode = 0
// DaifugoSuitLockPartial 片縛り (少なくとも1枚がスート一致)
DaifugoSuitLockPartial DaifugoSuitLockMode = 1
// DaifugoSuitLockFull 両縛り (全てスート一致)
DaifugoSuitLockFull DaifugoSuitLockMode = 2
)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(sentinel error, message string) *DomainErrorNewDomainError creates a DomainError wrapping the given sentinel.
func (de *DomainError) Error() stringError returns the user-facing message without the sentinel prefix.
### func (*DomainError) Unwrap
func (de *DomainError) Unwrap() errorUnwrap returns the sentinel error for use with errors.Is().
Doubt ダウトゲームクラス
type Doubt struct {
// contains filtered or unexported fields
}func NewDoubt(trumpCards *TrumpCards, players []*DoubtPlayer) *DoubtNewDoubt コンストラクタ
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() []*ActionLogEntryGetActionLog 棋譜を取得する
func (d *Doubt) GetConfig() DoubtConfigGetConfig ゲーム設定取得
### func (*Doubt) GetCpuActions
func (d *Doubt) GetCpuActions() []*DoubtCpuActionGetCpuActions CPUターンの行動履歴取得
### func (*Doubt) GetCpuDoubters
func (d *Doubt) GetCpuDoubters() []intGetCpuDoubters CPUダウターインデックスリスト取得
### func (*Doubt) GetCurrentTurn
func (d *Doubt) GetCurrentTurn() intGetCurrentTurn 現在の手番プレイヤーインデックス取得
### func (*Doubt) GetGameEndFlag
func (d *Doubt) GetGameEndFlag() boolGetGameEndFlag ゲーム終了フラグ取得
### func (*Doubt) GetHumanAction
func (d *Doubt) GetHumanAction() *DoubtCpuActionGetHumanAction 人間の最後の行動取得
### func (*Doubt) GetHumanProfile
func (d *Doubt) GetHumanProfile() *DoubtHumanProfileGetHumanProfile メタAIプロファイル取得
### func (*Doubt) GetLastAction
func (d *Doubt) GetLastAction() *DoubtActionGetLastAction 最後のプレイアクション取得
### func (*Doubt) GetLastDoubtResult
func (d *Doubt) GetLastDoubtResult() *DoubtDoubtResultGetLastDoubtResult 最後のダウト結果取得
func (d *Doubt) GetPhase() DoubtPhaseGetPhase 現在のフェーズ取得
func (d *Doubt) GetPlayer(i int) *DoubtPlayerGetPlayer プレイヤー取得
### func (*Doubt) GetPlayerCnt
func (d *Doubt) GetPlayerCnt() intGetPlayerCnt プレイヤー数取得
### func (*Doubt) GetTableCardCount
func (d *Doubt) GetTableCardCount() intGetTableCardCount テーブルカード枚数取得
### func (*Doubt) GetTableCards
func (d *Doubt) GetTableCards() []*CardGetTableCards テーブルカード取得
### func (*Doubt) GetTurnCounter
func (d *Doubt) GetTurnCounter() intGetTurnCounter ターンカウンター取得
### func (*Doubt) GetWinnerIdx
func (d *Doubt) GetWinnerIdx() intGetWinnerIdx 勝者インデックス取得 (-1 = まだ決まっていない)
### func (*Doubt) ImportProfile
func (d *Doubt) ImportProfile(data []byte) errorImportProfile JSONバイトからメタAIプロファイルをインポートする
func (d *Doubt) IsHumanTurn() boolIsHumanTurn 現在の手番が人間かどうか
func (d *Doubt) MarshalJSON() ([]byte, error)MarshalJSON implements json.Marshaler.
func (d *Doubt) PlayerPlay(cardIndices []int, claimedValue int, humanPlayMs int) errorPlayerPlay 人間プレイヤーがカードを出す cardIndices: 出すカードのインデックス, claimedValue: 宣言する値 (1-13), humanPlayMs: 迷い時間(ms, 0=計測なし)
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 (d *Doubt) SetConfig(cfg DoubtConfig)SetConfig ゲーム設定変更
func (d *Doubt) SkipDoubt()SkipDoubt ダウトをスキップ: テーブルカードはそのまま残り、手番が進む
### func (*Doubt) UnmarshalJSON
func (d *Doubt) UnmarshalJSON(data []byte) errorUnmarshalJSON implements json.Unmarshaler.
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) errorUnmarshalJSON implements json.Unmarshaler.
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() DoubtConfigDefaultDoubtConfig デフォルト設定を返す
### func (DoubtConfig) MarshalJSON
func (c DoubtConfig) MarshalJSON() ([]byte, error)MarshalJSON implements json.Marshaler.
### func (*DoubtConfig) UnmarshalJSON
func (c *DoubtConfig) UnmarshalJSON(data []byte) errorUnmarshalJSON implements json.Unmarshaler.
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) errorUnmarshalJSON implements json.Unmarshaler.
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) errorUnmarshalJSON implements json.Unmarshaler.
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() float64AdaptStrength 適応強度を返す (0.0 ~ 0.2)
### func (*DoubtHumanProfile) AdjustedBluffChance
func (p *DoubtHumanProfile) AdjustedBluffChance(base float64) float64AdjustedBluffChance 人間のダウト正解率に基づいて調整済みブラフ確率を返す
### func (*DoubtHumanProfile) AdjustedDoubtChance
func (p *DoubtHumanProfile) AdjustedDoubtChance(base float64, bracket int, humanPlayMs int) float64AdjustedDoubtChance ブラフ率と迷い時間に基づいて調整済みダウト確率を返す
### func (*DoubtHumanProfile) BluffRate
func (p *DoubtHumanProfile) BluffRate(bracket int) float64BluffRate 指定ブラケットのブラフ率を返す (データなしの場合0.5)
### func (*DoubtHumanProfile) DoubtAccuracy
func (p *DoubtHumanProfile) DoubtAccuracy() float64DoubtAccuracy 人間のダウト正解率を返す (データなしの場合0.5)
### func (*DoubtHumanProfile) Export
func (p *DoubtHumanProfile) Export() DoubtHumanProfileDataExport プロファイルデータをJSON永続化形式でエクスポートする
### func (*DoubtHumanProfile) HesitationBoost
func (p *DoubtHumanProfile) HesitationBoost(ms int) float64HesitationBoost 指定msの迷い時間に対するダウト確率ブーストを返す
### func (*DoubtHumanProfile) HesitationStdDev
func (p *DoubtHumanProfile) HesitationStdDev() float64HesitationStdDev 迷い時間の標準偏差を返す (データ不足の場合0)
### func (*DoubtHumanProfile) HesitationZScore
func (p *DoubtHumanProfile) HesitationZScore(ms int) float64HesitationZScore 指定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"`
}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をデコードする
DoubtMemoryLevel CPU の記憶力レベル
type DoubtMemoryLevel intconst (
// DoubtMemoryLevelEasy 低記憶力 (約30%の確率で記憶)
DoubtMemoryLevelEasy DoubtMemoryLevel = iota
// DoubtMemoryLevelNormal 中記憶力 (約70%の確率で記憶)
DoubtMemoryLevelNormal
// DoubtMemoryLevelHard 高記憶力 (100%記憶)
DoubtMemoryLevelHard
)DoubtPhase ゲームフェーズ
type DoubtPhase intconst (
// DoubtPhasePlay プレイフェーズ (カードを出す番)
DoubtPhasePlay DoubtPhase = 0
// DoubtPhaseDoubt ダウトフェーズ (ダウトするか判断する番)
DoubtPhaseDoubt DoubtPhase = 1
// DoubtPhaseEnd ゲーム終了フェーズ
DoubtPhaseEnd DoubtPhase = 2
)DoubtPlayer ダウトプレイヤークラス
type DoubtPlayer struct {
*GamePlayer
// contains filtered or unexported fields
}func NewDoubtPlayer(isHuman bool) *DoubtPlayerNewDoubtPlayer コンストラクタ
### func (*DoubtPlayer) CountKnownCards
func (p *DoubtPlayer) CountKnownCards(value int) intCountKnownCards 指定した値のカードを何枚知っているか返す (記憶 + 手札)
### 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) errorUnmarshalJSON implements json.Unmarshaler.
Euchre ユーカーゲームクラス
type Euchre struct {
// contains filtered or unexported fields
}func NewEuchre(trumpCards *TrumpCards, players []*EuchrePlayer, config EuchreConfig) *EuchreNewEuchre コンストラクタ
### func (*Euchre) CardRankPublic
func (e *Euchre) CardRankPublic(card *Card) intCardRankPublic カードランク取得 (テスト用公開メソッド)
### func (*Euchre) CpuCallTrump
func (e *Euchre) CpuCallTrump()CpuCallTrump CPUプレイヤーがコールトランプ判断する
func (e *Euchre) CpuDiscard()CpuDiscard CPUプレイヤー(ディーラー)がカードを1枚捨てる
func (e *Euchre) CpuPickUp()CpuPickUp CPUプレイヤーがピックアップ判断する
func (e *Euchre) CpuPlay()CpuPlay CPUプレイヤーが1ターン実行
### func (*Euchre) EffectiveSuitPublic
func (e *Euchre) EffectiveSuitPublic(card *Card) intEffectiveSuitPublic 実効スート取得 (テスト用公開メソッド)
### func (*Euchre) GetActionLog
func (e *Euchre) GetActionLog() []*ActionLogEntryGetActionLog 棋譜取得
### func (*Euchre) GetBidPlayerIdx
func (e *Euchre) GetBidPlayerIdx() intGetBidPlayerIdx ビッドプレイヤーインデックス取得
func (e *Euchre) GetConfig() EuchreConfigGetConfig 設定取得
### func (*Euchre) GetCurrentPlayerIdx
func (e *Euchre) GetCurrentPlayerIdx() intGetCurrentPlayerIdx 現在のプレイヤーインデックス取得
### func (*Euchre) GetCurrentTrick
func (e *Euchre) GetCurrentTrick() []*EuchreTrickCardGetCurrentTrick 現在のトリック取得
### func (*Euchre) GetDealerIdx
func (e *Euchre) GetDealerIdx() intGetDealerIdx ディーラーインデックス取得
### func (*Euchre) GetFaceUpCard
func (e *Euchre) GetFaceUpCard() *CardGetFaceUpCard 表向きカード取得 (nil = ピックアップ済み)
### func (*Euchre) GetGameEndFlag
func (e *Euchre) GetGameEndFlag() boolGetGameEndFlag ゲーム終了フラグ取得
### func (*Euchre) GetGoingAlone
func (e *Euchre) GetGoingAlone() boolGetGoingAlone ゴーアローン状態取得
### func (*Euchre) GetGoingAlonePlayerIdx
func (e *Euchre) GetGoingAlonePlayerIdx() intGetGoingAlonePlayerIdx ゴーアローンプレイヤーインデックス取得
func (e *Euchre) GetHint() *EuchreHintGetHint ヒントを取得する
func (e *Euchre) GetKitty() []*CardGetKitty キティ取得
### func (*Euchre) GetLeadPlayerIdx
func (e *Euchre) GetLeadPlayerIdx() intGetLeadPlayerIdx リードプレイヤーインデックス取得
### func (*Euchre) GetMakerTeam
func (e *Euchre) GetMakerTeam() intGetMakerTeam メイカーチーム取得
func (e *Euchre) GetPhase() EuchrePhaseGetPhase 現在のフェーズ取得
func (e *Euchre) GetPlayer(i int) *EuchrePlayerGetPlayer プレイヤー取得
### func (*Euchre) GetPlayerCnt
func (e *Euchre) GetPlayerCnt() intGetPlayerCnt プレイヤー数取得
### func (*Euchre) GetRoundNumber
func (e *Euchre) GetRoundNumber() intGetRoundNumber 現在のラウンド番号取得
### func (*Euchre) GetTeamScore
func (e *Euchre) GetTeamScore(team int) intGetTeamScore チームスコア取得
### func (*Euchre) GetTrickNumber
func (e *Euchre) GetTrickNumber() intGetTrickNumber 現在のトリック番号取得
### func (*Euchre) GetTrumpSuit
func (e *Euchre) GetTrumpSuit() intGetTrumpSuit 切り札スート取得
### func (*Euchre) GetValidPlayIndices
func (e *Euchre) GetValidPlayIndices(playerIdx int) []intGetValidPlayIndices プレイ可能なカードのインデックスリストを返す (Web用)
### func (*Euchre) GetWinnerTeam
func (e *Euchre) GetWinnerTeam() intGetWinnerTeam 勝利チーム取得 (-1 = 未確定)
### func (*Euchre) IsHumanBidTurn
func (e *Euchre) IsHumanBidTurn() boolIsHumanBidTurn 現在のビッド手番が人間かどうか
### func (*Euchre) IsHumanTurn
func (e *Euchre) IsHumanTurn() boolIsHumanTurn 現在の手番が人間かどうか
### func (*Euchre) MarshalJSON
func (e *Euchre) MarshalJSON() ([]byte, error)MarshalJSON implements json.Marshaler.
func (e *Euchre) NextRound()NextRound 次のラウンドを開始する
func (e *Euchre) NextTrick()NextTrick 次のトリックを開始する
### func (*Euchre) PlayerCallTrump
func (e *Euchre) PlayerCallTrump(suit int, goAlone bool) errorPlayerCallTrump 人間プレイヤーがスートを指名する
### func (*Euchre) PlayerDiscard
func (e *Euchre) PlayerDiscard(cardIndex int) errorPlayerDiscard 人間プレイヤー(ディーラー)がカードを1枚捨てる
### func (*Euchre) PlayerPassCall
func (e *Euchre) PlayerPassCall() errorPlayerPassCall 人間プレイヤーがコールフェーズでパスする
### func (*Euchre) PlayerPickUp
func (e *Euchre) PlayerPickUp(orderUp bool, goAlone bool) errorPlayerPickUp 人間プレイヤーがピックアップ判断する
func (e *Euchre) PlayerPlay(cardIndex int) errorPlayerPlay 人間プレイヤーがカードをプレイする
func (e *Euchre) Reset()Reset ゲーム初期化
### func (*Euchre) ResolveTrick
func (e *Euchre) ResolveTrick()ResolveTrick トリックを解決して勝者を決定する
func (e *Euchre) ScoreRound()ScoreRound ラウンドのスコアを確定し、ゲーム終了判定を行う
### func (*Euchre) SetBidPlayerIdx
func (e *Euchre) SetBidPlayerIdx(idx int)SetBidPlayerIdx ビッドプレイヤーインデックス設定 (テスト用)
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 (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) errorUnmarshalJSON implements json.Unmarshaler.
EuchreConfig ユーカーゲーム設定
type EuchreConfig struct {
CpuDifficulty EuchreCpuDifficulty `json:"cd"`
PointLimit int `json:"pl"` // ゲーム終了スコア (先に到達したチームが勝利, デフォルト10)
}func DefaultEuchreConfig() EuchreConfigDefaultEuchreConfig デフォルト設定を返す
### func (EuchreConfig) Validate
func (c EuchreConfig) Validate() errorValidate 設定値のドメインバリデーション
EuchreCpuDifficulty CPU の難易度レベル
type EuchreCpuDifficulty intconst (
// EuchreCpuDifficultyEasy 低難易度
EuchreCpuDifficultyEasy EuchreCpuDifficulty = iota
// EuchreCpuDifficultyNormal 中難易度
EuchreCpuDifficultyNormal
// EuchreCpuDifficultyHard 高難易度
EuchreCpuDifficultyHard
)EuchreHint ヒント情報
type EuchreHint struct {
CardIndex *int // 推奨カードインデックス (プレイ/ディスカード時)
OrderUp *bool // ピックアップすべきか
Suit *int // 推奨スート (コールトランプ時)
GoAlone *bool // ゴーアローンすべきか
Reason string // ヒント理由キー
}EuchrePhase ゲームフェーズ
type EuchrePhase intconst (
// 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
)EuchrePlayer ユーカープレイヤークラス
type EuchrePlayer struct {
*GamePlayer
TrickHolder
// contains filtered or unexported fields
}func NewEuchrePlayer(isHuman bool, team int) *EuchrePlayerNewEuchrePlayer コンストラクタ
### func (*EuchrePlayer) GetTeam
func (p *EuchrePlayer) GetTeam() intGetTeam チームインデックスを取得
### 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) errorUnmarshalJSON implements json.Unmarshaler.
EuchreTrickCard トリック中の1枚
type EuchreTrickCard struct {
PlayerIdx int `json:"pi"`
Card *Card `json:"c"`
}FreeCell フリーセルゲームクラス
type FreeCell struct {
// contains filtered or unexported fields
}func NewFreeCell(trumpCards *TrumpCards) *FreeCellNewFreeCell コンストラクタ
### func (*FreeCell) AutoComplete
func (f *FreeCell) AutoComplete() errorAutoComplete オートコンプリート
func (f *FreeCell) CanUndo() boolCanUndo アンドゥ可能かどうか
### func (*FreeCell) GetActionLog
func (f *FreeCell) GetActionLog() []*ActionLogEntryGetActionLog 棋譜取得
### func (*FreeCell) GetFoundation
func (f *FreeCell) GetFoundation() [FreeCellFoundationCnt][]*CardGetFoundation ファンデーション取得
### func (*FreeCell) GetFreeCells
func (f *FreeCell) GetFreeCells() [FreeCellCellCnt]*CardGetFreeCells フリーセル取得
func (f *FreeCell) GetHint() *FreeCellHintGetHint ヒントを取得
### func (*FreeCell) GetMoveCount
func (f *FreeCell) GetMoveCount() intGetMoveCount 移動回数取得
func (f *FreeCell) GetPhase() FreeCellPhaseGetPhase フェーズ取得
### func (*FreeCell) GetTableau
func (f *FreeCell) GetTableau() [FreeCellTableauCnt][]*CardGetTableau タブロー取得
func (f *FreeCell) GiveUp()GiveUp ギブアップ
### func (*FreeCell) IsStalemate
func (f *FreeCell) IsStalemate() boolIsStalemate 手詰まり状態取得
### func (*FreeCell) MarshalJSON
func (f *FreeCell) MarshalJSON() ([]byte, error)MarshalJSON implements json.Marshaler.
### func (*FreeCell) MoveFreeCellToFoundation
func (f *FreeCell) MoveFreeCellToFoundation(cell int) errorMoveFreeCellToFoundation フリーセルからファンデーションにカードを移動
### func (*FreeCell) MoveFreeCellToTableau
func (f *FreeCell) MoveFreeCellToTableau(cell, col int) errorMoveFreeCellToTableau フリーセルからタブローにカードを移動
### func (*FreeCell) MoveTableauToFoundation
func (f *FreeCell) MoveTableauToFoundation(col int) errorMoveTableauToFoundation タブローからファンデーションにカードを移動
### func (*FreeCell) MoveTableauToFreeCell
func (f *FreeCell) MoveTableauToFreeCell(col, cell int) errorMoveTableauToFreeCell タブローからフリーセルにカードを移動
### func (*FreeCell) MoveTableauToTableau
func (f *FreeCell) MoveTableauToTableau(fromCol, cardIndex, toCol int) errorMoveTableauToTableau タブローからタブローにカードを移動(スーパームーブ対応)
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 (f *FreeCell) SetPhase(phase FreeCellPhase)SetPhase フェーズ設定 (テスト用)
### func (*FreeCell) SetTableau
func (f *FreeCell) SetTableau(tableau [FreeCellTableauCnt][]*Card)SetTableau タブロー設定 (テスト用)
func (f *FreeCell) Undo() errorUndo 直前の操作を取り消す
func (f *FreeCell) UndoN(n int) errorUndoN n回連続でアンドゥを実行する。
### func (*FreeCell) UndoToEscape
func (f *FreeCell) UndoToEscape() intUndoToEscape 膠着状態から抜けるために必要なアンドゥ回数を返す。膠着状態でなければ0、脱出不可なら-1。
### func (*FreeCell) UnmarshalJSON
func (f *FreeCell) UnmarshalJSON(data []byte) errorUnmarshalJSON implements json.Unmarshaler.
FreeCellHint ヒント
type FreeCellHint struct {
FromZone string // "tableau" or "freecell"
FromCol int
CardIndex int
ToZone string // "tableau", "foundation", or "freecell"
ToCol int
}FreeCellPhase フリーセルゲームフェーズ
type FreeCellPhase intconst (
// FreeCellPhasePlaying プレイ中
FreeCellPhasePlaying FreeCellPhase = iota
// FreeCellPhaseGameClear ゲームクリア
FreeCellPhaseGameClear
// FreeCellPhaseGameOver ゲームオーバー
FreeCellPhaseGameOver
)GamePlayer isHuman/isFinished を持つプレイヤー共通構造体
type GamePlayer struct {
Player
// contains filtered or unexported fields
}func NewGamePlayer(isHuman bool) *GamePlayerNewGamePlayer コンストラクタ
### func (*GamePlayer) GetIsFinished
func (gp *GamePlayer) GetIsFinished() boolGetIsFinished 上がっているかどうか
### func (*GamePlayer) GetIsHuman
func (gp *GamePlayer) GetIsHuman() boolGetIsHuman 人間プレイヤーかどうか
### 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) errorUnmarshalJSON implements json.Unmarshaler.
GameResult ゲーム勝敗結果
type GameResult intconst (
// GameResultWin 勝利
GameResultWin GameResult = 1
// GameResultDraw 引き分け
GameResultDraw GameResult = 0
// GameResultLose 敗北
GameResultLose GameResult = -1
)GinRummy ジンラミーゲームクラス
type GinRummy struct {
// contains filtered or unexported fields
}func NewGinRummy(trumpCards *TrumpCards, players []*GinRummyPlayer, config GinRummyConfig) *GinRummyNewGinRummy コンストラクタ
func (g *GinRummy) CpuPlay()CpuPlay 現在の手番がCPUの場合にターンを実行
### func (*GinRummy) GetActionLog
func (g *GinRummy) GetActionLog() []*ActionLogEntryGetActionLog 棋譜取得
### func (*GinRummy) GetConfig
func (g *GinRummy) GetConfig() GinRummyConfigGetConfig 設定取得
### func (*GinRummy) GetCurrentPlayerIdx
func (g *GinRummy) GetCurrentPlayerIdx() intGetCurrentPlayerIdx 現在のプレイヤーインデックス取得
### func (*GinRummy) GetDiscardPile
func (g *GinRummy) GetDiscardPile() []*CardGetDiscardPile 捨て札の山を取得
### func (*GinRummy) GetDiscardTop
func (g *GinRummy) GetDiscardTop() *CardGetDiscardTop 捨て札の一番上を取得
### func (*GinRummy) GetDrawPileCount
func (g *GinRummy) GetDrawPileCount() intGetDrawPileCount 山札の残り枚数取得
### func (*GinRummy) GetGameEndFlag
func (g *GinRummy) GetGameEndFlag() boolGetGameEndFlag ゲーム終了フラグ取得
func (g *GinRummy) GetIsGin() boolGetIsGin ジンかどうか取得
### func (*GinRummy) GetKnockerDeadwood
func (g *GinRummy) GetKnockerDeadwood() []*CardGetKnockerDeadwood ノッカーのデッドウッド取得
### func (*GinRummy) GetKnockerIdx
func (g *GinRummy) GetKnockerIdx() intGetKnockerIdx ノッカーのインデックス取得
### func (*GinRummy) GetKnockerMelds
func (g *GinRummy) GetKnockerMelds() [][]*CardGetKnockerMelds ノッカーのメルド取得
func (g *GinRummy) GetPhase() GinRummyPhaseGetPhase 現在のフェーズ取得
### func (*GinRummy) GetPlayer
func (g *GinRummy) GetPlayer(i int) *GinRummyPlayerGetPlayer プレイヤー取得
### func (*GinRummy) GetPlayerCnt
func (g *GinRummy) GetPlayerCnt() intGetPlayerCnt プレイヤー数取得
### func (*GinRummy) GetRoundNumber
func (g *GinRummy) GetRoundNumber() intGetRoundNumber 現在のラウンド番号取得
### func (*GinRummy) GetWinnerIdx
func (g *GinRummy) GetWinnerIdx() intGetWinnerIdx 勝者インデックス取得 (-1 = 未確定)
### func (*GinRummy) IsHumanTurn
func (g *GinRummy) IsHumanTurn() boolIsHumanTurn 現在の手番が人間かどうか
### 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) errorPlayerDiscard 人間プレイヤーがカードを捨てる
### func (*GinRummy) PlayerDrawFromDiscard
func (g *GinRummy) PlayerDrawFromDiscard() errorPlayerDrawFromDiscard 人間プレイヤーが捨て札からカードを引く
### func (*GinRummy) PlayerDrawFromStock
func (g *GinRummy) PlayerDrawFromStock() errorPlayerDrawFromStock 人間プレイヤーが山札からカードを引く
### func (*GinRummy) PlayerKnock
func (g *GinRummy) PlayerKnock(cardIndex int) errorPlayerKnock 人間プレイヤーがノックする (カードを1枚捨ててノック)
### func (*GinRummy) PlayerLayoff
func (g *GinRummy) PlayerLayoff(cardIndices []int) errorPlayerLayoff 人間プレイヤーがレイオフするカードを選択する (空のindicesでレイオフ終了)
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 (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 (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) errorUnmarshalJSON implements json.Unmarshaler.
GinRummyConfig ジンラミーゲーム設定
type GinRummyConfig struct {
CpuDifficulty GinRummyCpuDifficulty `json:"cd"`
PointLimit int `json:"pl"` // ゲーム終了スコア (先に到達したプレイヤーが勝利)
}### func DefaultGinRummyConfig
func DefaultGinRummyConfig() GinRummyConfigDefaultGinRummyConfig デフォルト設定を返す
### func (GinRummyConfig) Validate
func (c GinRummyConfig) Validate() errorValidate 設定値のドメインバリデーション
GinRummyCpuDifficulty CPU の難易度レベル
type GinRummyCpuDifficulty intconst (
// GinRummyCpuDifficultyEasy 低難易度
GinRummyCpuDifficultyEasy GinRummyCpuDifficulty = iota
// GinRummyCpuDifficultyNormal 中難易度
GinRummyCpuDifficultyNormal
// GinRummyCpuDifficultyHard 高難易度
GinRummyCpuDifficultyHard
)GinRummyPhase ゲームフェーズ
type GinRummyPhase intconst (
// GinRummyPhaseDraw ドローフェーズ (山札または捨て札から引く)
GinRummyPhaseDraw GinRummyPhase = 0
// GinRummyPhaseDiscard ディスカードフェーズ (手札から1枚捨てる or ノック/ジン)
GinRummyPhaseDiscard GinRummyPhase = 1
// GinRummyPhaseLayoff レイオフフェーズ (相手がノッカーのメルドにカードを付ける)
GinRummyPhaseLayoff GinRummyPhase = 2
// GinRummyPhaseRoundEnd ラウンド終了フェーズ
GinRummyPhaseRoundEnd GinRummyPhase = 3
// GinRummyPhaseGameEnd ゲーム終了フェーズ
GinRummyPhaseGameEnd GinRummyPhase = 4
)GinRummyPlayer ジンラミープレイヤークラス
type GinRummyPlayer struct {
*GamePlayer
RoundScoreHolder
}func NewGinRummyPlayer(isHuman bool) *GinRummyPlayerNewGinRummyPlayer コンストラクタ
### 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) errorUnmarshalJSON implements json.Unmarshaler.
GoFish Go Fishゲームクラス
type GoFish struct {
// contains filtered or unexported fields
}func NewGoFish(trumpCards *TrumpCards, players []*GoFishPlayer) *GoFishNewGoFish コンストラクタ
func (g *GoFish) CpuAsk() errorCpuAsk CPUプレイヤーが1回要求を実行する
### func (*GoFish) GetActionLog
func (g *GoFish) GetActionLog() []*ActionLogEntryGetActionLog 棋譜を取得する
func (g *GoFish) GetConfig() GoFishConfigGetConfig ゲーム設定を取得する
### func (*GoFish) GetCpuActions
func (g *GoFish) GetCpuActions() []*GoFishCpuActionGetCpuActions CPUターンの行動履歴を取得する
### func (*GoFish) GetCurrentTurn
func (g *GoFish) GetCurrentTurn() intGetCurrentTurn 現在の手番プレイヤーインデックスを取得する
### func (*GoFish) GetDeckRemaining
func (g *GoFish) GetDeckRemaining() intGetDeckRemaining 山札の残り枚数を取得する
### func (*GoFish) GetGameEndFlag
func (g *GoFish) GetGameEndFlag() boolGetGameEndFlag ゲーム終了フラグを取得する
### func (*GoFish) GetHumanAction
func (g *GoFish) GetHumanAction() *GoFishCpuActionGetHumanAction 人間の最後の行動記録を取得する
### func (*GoFish) GetLastAskPlayerIdx
func (g *GoFish) GetLastAskPlayerIdx() intGetLastAskPlayerIdx 最後に要求したプレイヤーのインデックスを取得する
### func (*GoFish) GetLastAskRank
func (g *GoFish) GetLastAskRank() intGetLastAskRank 最後に要求されたランクを取得する
### func (*GoFish) GetLastAskSuccess
func (g *GoFish) GetLastAskSuccess() boolGetLastAskSuccess 最後の要求が成功したかを返す
### func (*GoFish) GetLastAskTargetIdx
func (g *GoFish) GetLastAskTargetIdx() intGetLastAskTargetIdx 最後に要求された相手のインデックスを取得する
### func (*GoFish) GetLastBookFormed
func (g *GoFish) GetLastBookFormed() boolGetLastBookFormed 最後のアクションでブックが完成したかを返す
### func (*GoFish) GetLastBookRank
func (g *GoFish) GetLastBookRank() intGetLastBookRank 最後に完成したブックのランクを取得する
### func (*GoFish) GetLastCardsReceived
func (g *GoFish) GetLastCardsReceived() []*CardGetLastCardsReceived 最後に受け取ったカードを取得する
### func (*GoFish) GetLastDrawnCard
func (g *GoFish) GetLastDrawnCard() *CardGetLastDrawnCard 最後にGo Fishで引いたカードを取得する
func (g *GoFish) GetPhase() GoFishPhaseGetPhase ゲームフェーズを取得する
func (g *GoFish) GetPlayer(i int) *GoFishPlayerGetPlayer 指定インデックスのプレイヤーを取得する
### func (*GoFish) GetPlayerCnt
func (g *GoFish) GetPlayerCnt() intGetPlayerCnt プレイヤー数を取得する
### func (*GoFish) GetTurnNumber
func (g *GoFish) GetTurnNumber() intGetTurnNumber 現在のターン番号を取得する
### func (*GoFish) GetWinnerIdx
func (g *GoFish) GetWinnerIdx() intGetWinnerIdx 勝者プレイヤーインデックスを取得する
### func (*GoFish) IsHumanTurn
func (g *GoFish) IsHumanTurn() boolIsHumanTurn 現在の手番が人間かを返す
### func (*GoFish) MarshalJSON
func (g *GoFish) MarshalJSON() ([]byte, error)MarshalJSON implements json.Marshaler.
func (g *GoFish) PlayerAsk(targetIdx, rank int) errorPlayerAsk 人間プレイヤーが相手にランクを要求する
func (g *GoFish) Reset()Reset ゲームを初期化する
func (g *GoFish) SetConfig(config GoFishConfig)SetConfig ゲーム設定をセットする
### func (*GoFish) UnmarshalJSON
func (g *GoFish) UnmarshalJSON(data []byte) errorUnmarshalJSON implements json.Unmarshaler.
GoFishConfig Go Fishゲーム設定
type GoFishConfig struct {
CpuDifficulty GoFishCpuDifficulty
}func DefaultGoFishConfig() GoFishConfigDefaultGoFishConfig デフォルト設定を返す
### func (GoFishConfig) MarshalJSON
func (c GoFishConfig) MarshalJSON() ([]byte, error)MarshalJSON implements json.Marshaler.
### func (*GoFishConfig) UnmarshalJSON
func (c *GoFishConfig) UnmarshalJSON(data []byte) errorUnmarshalJSON implements json.Unmarshaler.
### func (GoFishConfig) Validate
func (c GoFishConfig) Validate() errorValidate 設定値のドメインバリデーション
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)
}GoFishCpuDifficulty CPU の難易度レベル
type GoFishCpuDifficulty intconst (
// GoFishCpuDifficultyEasy 低難易度: ランダムに要求
GoFishCpuDifficultyEasy GoFishCpuDifficulty = iota
// GoFishCpuDifficultyNormal 中難易度: 手札のランクのみ要求、直近の記憶に依存
GoFishCpuDifficultyNormal
// GoFishCpuDifficultyHard 高難易度: 全要求履歴から最適な相手とランクを推測
GoFishCpuDifficultyHard
)GoFishPhase ゲームフェーズ
type GoFishPhase intconst (
GoFishPhasePlay GoFishPhase = iota // プレイ中
GoFishPhaseGameEnd // ゲーム終了
)GoFishPlayer Go Fishプレイヤークラス
type GoFishPlayer struct {
*GamePlayer
// contains filtered or unexported fields
}func NewGoFishPlayer(isHuman bool) *GoFishPlayerNewGoFishPlayer コンストラクタ
### func (*GoFishPlayer) AddBook
func (p *GoFishPlayer) AddBook(cards []*Card)AddBook ブックを追加する
### func (*GoFishPlayer) CountRank
func (p *GoFishPlayer) CountRank(rank int) intCountRank 指定ランクのカード枚数を返す
### func (*GoFishPlayer) GetBookCount
func (p *GoFishPlayer) GetBookCount() intGetBookCount 完成したブック数を取得する
### func (*GoFishPlayer) GetBooks
func (p *GoFishPlayer) GetBooks() [][]*CardGetBooks 完成したブック一覧を取得する
### func (*GoFishPlayer) GetDistinctRanks
func (p *GoFishPlayer) GetDistinctRanks() []intGetDistinctRanks 手札に含まれるユニークなランク一覧を返す
### func (*GoFishPlayer) HasRank
func (p *GoFishPlayer) HasRank(rank int) boolHasRank 指定ランクのカードを手札に持っているかを返す
### func (*GoFishPlayer) MarshalJSON
func (p *GoFishPlayer) MarshalJSON() ([]byte, error)MarshalJSON implements json.Marshaler.
### func (*GoFishPlayer) RemoveAllOfRank
func (p *GoFishPlayer) RemoveAllOfRank(rank int) []*CardRemoveAllOfRank 指定ランクのカードを全て手札から取り除いて返す
### func (*GoFishPlayer) ResetBooks
func (p *GoFishPlayer) ResetBooks()ResetBooks ブックをリセットする
### func (*GoFishPlayer) UnmarshalJSON
func (p *GoFishPlayer) UnmarshalJSON(data []byte) errorUnmarshalJSON implements json.Unmarshaler.
Golf ゴルフソリティアゲームクラス
type Golf struct {
// contains filtered or unexported fields
}func NewGolf(trumpCards *TrumpCards) *GolfNewGolf コンストラクタ
func (g *Golf) AllRemoved() boolAllRemoved 全タブローカードが除去されたか
func (g *Golf) CanUndo() boolCanUndo アンドゥ可能かどうか
func (g *Golf) Draw() errorDraw ストックからウェイストにカードを引く
func (g *Golf) GetActionLog() []*ActionLogEntryGetActionLog 棋譜取得
func (g *Golf) GetHint() *GolfHintGetHint ヒントを取得
func (g *Golf) GetLayout() [GolfColCnt][GolfRowCnt]*GolfCardGetLayout レイアウト取得
func (g *Golf) GetMoveCount() intGetMoveCount 移動回数取得
func (g *Golf) GetPhase() GolfPhaseGetPhase フェーズ取得
### func (*Golf) GetStockCount
func (g *Golf) GetStockCount() intGetStockCount ストック枚数取得
func (g *Golf) GetWaste() []*CardGetWaste ウェイスト取得
func (g *Golf) GiveUp()GiveUp ギブアップ
func (g *Golf) IsExposed(col, row int) boolIsExposed カードが露出しているか (テスト用の公開版)
func (g *Golf) IsStalemate() boolIsStalemate 手詰まり状態取得
func (g *Golf) MarshalJSON() ([]byte, error)MarshalJSON implements json.Marshaler.
func (g *Golf) Remove(col int) errorRemove タブローのカードを除去
func (g *Golf) Reset()Reset ゲームリセット
### func (*Golf) SetIsStalemate
func (g *Golf) SetIsStalemate(v bool)SetIsStalemate 手詰まり状態設定 (テスト用)
func (g *Golf) SetLayout(layout [GolfColCnt][GolfRowCnt]*GolfCard)SetLayout レイアウト設定 (テスト用)
func (g *Golf) SetPhase(phase GolfPhase)SetPhase フェーズ設定 (テスト用)
func (g *Golf) SetStock(stock []*Card)SetStock ストック設定 (テスト用)
func (g *Golf) SetWaste(waste []*Card)SetWaste ウェイスト設定 (テスト用)
func (g *Golf) Undo() errorUndo 直前の操作を取り消す
func (g *Golf) UndoN(n int) errorUndoN n回連続でアンドゥを実行する。
func (g *Golf) UndoToEscape() intUndoToEscape 膠着状態から抜けるために必要なアンドゥ回数を返す。膠着状態でなければ0、脱出不可なら-1。
### func (*Golf) UnmarshalJSON
func (g *Golf) UnmarshalJSON(data []byte) errorUnmarshalJSON implements json.Unmarshaler.
GolfCard タブロー上のカード
type GolfCard struct {
Card *Card `json:"c"`
Removed bool `json:"r"`
}GolfHint ヒント
type GolfHint struct {
Type string // "remove" or "draw"
Col int
}GolfPhase ゴルフソリティアゲームフェーズ
type GolfPhase intconst (
// GolfPhasePlaying プレイ中
GolfPhasePlaying GolfPhase = iota
// GolfPhaseGameClear ゲームクリア
GolfPhaseGameClear
// GolfPhaseGameOver ゲームオーバー
GolfPhaseGameOver
)Hearts ハーツゲームクラス
type Hearts struct {
// contains filtered or unexported fields
}func NewHearts(trumpCards *TrumpCards, players []*HeartsPlayer, config HeartsConfig) *HeartsNewHearts コンストラクタ
func (h *Hearts) CpuPass()CpuPass すべてのCPUプレイヤーがカードを選択する
func (h *Hearts) CpuPlay()CpuPlay 現在の手番がCPUの場合に1ターン実行
### func (*Hearts) ExecutePass
func (h *Hearts) ExecutePass()ExecutePass カード交換を実行する
### func (*Hearts) GetActionLog
func (h *Hearts) GetActionLog() []*ActionLogEntryGetActionLog 棋譜取得
func (h *Hearts) GetConfig() HeartsConfigGetConfig 設定取得
### func (*Hearts) GetCurrentPlayerIdx
func (h *Hearts) GetCurrentPlayerIdx() intGetCurrentPlayerIdx 現在のプレイヤーインデックス取得
### func (*Hearts) GetCurrentTrick
func (h *Hearts) GetCurrentTrick() []*HeartsTrickCardGetCurrentTrick 現在のトリック取得
### func (*Hearts) GetGameEndFlag
func (h *Hearts) GetGameEndFlag() boolGetGameEndFlag ゲーム終了フラグ取得
### func (*Hearts) GetHeartsBroken
func (h *Hearts) GetHeartsBroken() boolGetHeartsBroken ハーツブレイク状態取得
func (h *Hearts) GetHint() *HeartsHintGetHint ヒントを取得する
### func (*Hearts) GetLeadPlayerIdx
func (h *Hearts) GetLeadPlayerIdx() intGetLeadPlayerIdx リードプレイヤーインデックス取得
### func (*Hearts) GetPassDirection
func (h *Hearts) GetPassDirection() HeartsPassDirectionGetPassDirection 現在のラウンドの交換方向取得
### func (*Hearts) GetPassReady
func (h *Hearts) GetPassReady() [HeartsPlayerCnt]boolGetPassReady パス準備状態取得
### func (*Hearts) GetPassedCards
func (h *Hearts) GetPassedCards() [HeartsPlayerCnt][]*CardGetPassedCards パス済みカード取得
func (h *Hearts) GetPhase() HeartsPhaseGetPhase 現在のフェーズ取得
func (h *Hearts) GetPlayer(i int) *HeartsPlayerGetPlayer プレイヤー取得
### func (*Hearts) GetPlayerCnt
func (h *Hearts) GetPlayerCnt() intGetPlayerCnt プレイヤー数取得
### func (*Hearts) GetRoundNumber
func (h *Hearts) GetRoundNumber() intGetRoundNumber 現在のラウンド番号取得
### func (*Hearts) GetTrickNumber
func (h *Hearts) GetTrickNumber() intGetTrickNumber 現在のトリック番号取得
### func (*Hearts) GetWinnerIdx
func (h *Hearts) GetWinnerIdx() intGetWinnerIdx 勝者インデックス取得 (-1 = 未確定)
### func (*Hearts) IsHumanTurn
func (h *Hearts) IsHumanTurn() boolIsHumanTurn 現在の手番が人間かどうか
### func (*Hearts) MarshalJSON
func (h *Hearts) MarshalJSON() ([]byte, error)MarshalJSON implements json.Marshaler.
func (h *Hearts) NextRound()NextRound 次のラウンドを開始する
func (h *Hearts) NextTrick()NextTrick 次のトリックを開始する
func (h *Hearts) PlayerPass(cardIndices []int) errorPlayerPass 人間プレイヤーがカードを渡す
func (h *Hearts) PlayerPlay(cardIndex int) errorPlayerPlay 人間プレイヤーがカードをプレイする
func (h *Hearts) Reset()Reset ゲーム初期化: デッキをシャッフルして配布し、最初のフェーズを設定
### func (*Hearts) ResolveTrick
func (h *Hearts) ResolveTrick()ResolveTrick トリックを解決して勝者を決定する
func (h *Hearts) ScoreRound()ScoreRound ラウンドのスコアを確定し、ゲーム終了判定を行う
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 (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) errorUnmarshalJSON implements json.Unmarshaler.
HeartsConfig ハーツゲーム設定
type HeartsConfig struct {
CpuDifficulty HeartsCpuDifficulty `json:"cd"`
PointLimit int `json:"pl"` // ゲーム終了スコア (いずれかのプレイヤーがこの点数に達したら終了)
OmnibusJD bool `json:"oj"` // オムニバス・ハーツ: J♦獲得で-10点
}func DefaultHeartsConfig() HeartsConfigDefaultHeartsConfig デフォルト設定を返す
### func (HeartsConfig) Validate
func (c HeartsConfig) Validate() errorValidate 設定値のドメインバリデーション
HeartsCpuDifficulty CPU の難易度レベル
type HeartsCpuDifficulty intconst (
// HeartsCpuDifficultyEasy 低難易度
HeartsCpuDifficultyEasy HeartsCpuDifficulty = iota
// HeartsCpuDifficultyNormal 中難易度
HeartsCpuDifficultyNormal
// HeartsCpuDifficultyHard 高難易度
HeartsCpuDifficultyHard
)HeartsHint ヒント情報
type HeartsHint struct {
CardIndices []int // 推奨カードインデックス (プレイ時1枚, パス時3枚)
Reason string // ヒント理由キー
}HeartsPassDirection カード交換方向
type HeartsPassDirection intconst (
// HeartsPassLeft 左へ渡す
HeartsPassLeft HeartsPassDirection = 0
// HeartsPassRight 右へ渡す
HeartsPassRight HeartsPassDirection = 1
// HeartsPassAcross 向かいへ渡す
HeartsPassAcross HeartsPassDirection = 2
// HeartsPassNone 交換なし
HeartsPassNone HeartsPassDirection = 3
)HeartsPhase ゲームフェーズ
type HeartsPhase intconst (
// HeartsPhasePass カード交換フェーズ
HeartsPhasePass HeartsPhase = 0
// HeartsPhasePlay トリックプレイフェーズ
HeartsPhasePlay HeartsPhase = 1
// HeartsPhaseTrickEnd トリック終了フェーズ
HeartsPhaseTrickEnd HeartsPhase = 2
// HeartsPhaseRoundEnd ラウンド終了フェーズ
HeartsPhaseRoundEnd HeartsPhase = 3
// HeartsPhaseGameEnd ゲーム終了フェーズ
HeartsPhaseGameEnd HeartsPhase = 4
)HeartsPlayer ハーツプレイヤークラス
type HeartsPlayer struct {
*GamePlayer
RoundScoreHolder
TrickHolder
}func NewHeartsPlayer(isHuman bool) *HeartsPlayerNewHeartsPlayer コンストラクタ
### 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) errorUnmarshalJSON implements json.Unmarshaler.
HeartsTrickCard トリック中の1枚
type HeartsTrickCard struct {
PlayerIdx int `json:"pi"`
Card *Card `json:"c"`
}Holdem テキサスホールデムクラス
type Holdem struct {
// contains filtered or unexported fields
}func NewHoldem(trumpCards *TrumpCards, players []*HoldemPlayer, config HoldemConfig) *HoldemNewHoldem コンストラクタ
func (h *Holdem) Addon() errorAddon 人間プレイヤーがアドオンを実行する
### func (*Holdem) ExportProfile
func (h *Holdem) ExportProfile() interface{}ExportProfile メタAIプロファイルをエクスポートする (プロファイルがない場合はnil)
### func (*Holdem) GetActedFlags
func (h *Holdem) GetActedFlags() []boolGetActedFlags actedフラグ取得
### func (*Holdem) GetActionLog
func (h *Holdem) GetActionLog() []*ActionLogEntryGetActionLog 棋譜を取得する
### func (*Holdem) GetAddonUsed
func (h *Holdem) GetAddonUsed() []boolGetAddonUsed プレイヤーごとのアドオン使用フラグ取得
### func (*Holdem) GetCommunityCards
func (h *Holdem) GetCommunityCards() []*CardGetCommunityCards コミュニティカード取得
func (h *Holdem) GetConfig() HoldemConfigGetConfig 設定取得
### func (*Holdem) GetCpuActions
func (h *Holdem) GetCpuActions() []HoldemCpuActionGetCpuActions CPU行動記録取得
### func (*Holdem) GetCurrentTurn
func (h *Holdem) GetCurrentTurn() intGetCurrentTurn 現在のターン取得
### func (*Holdem) GetDealerIdx
func (h *Holdem) GetDealerIdx() intGetDealerIdx ディーラーインデックス取得
func (h *Holdem) GetEquity() *HoldemEquityResultGetEquity エクイティ計算結果を返す (PreFlop-Riverフェーズで人間がフォールドしていない場合のみ)
### func (*Holdem) GetGameEndFlag
func (h *Holdem) GetGameEndFlag() boolGetGameEndFlag ゲーム終了フラグ取得
### func (*Holdem) GetHandCount
func (h *Holdem) GetHandCount() intGetHandCount ハンド数取得
### func (*Holdem) GetHumanProfile
func (h *Holdem) GetHumanProfile() *BettingHumanProfileGetHumanProfile メタAIプロファイル取得
func (h *Holdem) GetLastBet() intGetLastBet 最後のベット取得
### func (*Holdem) GetLastCpuError
func (h *Holdem) GetLastCpuError() errorGetLastCpuError 最後のCPUアクションエラー取得 (テスト・デバッグ用)
### func (*Holdem) GetMinRaise
func (h *Holdem) GetMinRaise() intGetMinRaise 最小レイズ額取得
func (h *Holdem) GetPhase() intGetPhase フェーズ取得
func (h *Holdem) GetPlayer(i int) *HoldemPlayerGetPlayer 指定プレイヤー取得
### func (*Holdem) GetPlayerCnt
func (h *Holdem) GetPlayerCnt() intGetPlayerCnt プレイヤー数取得
func (h *Holdem) GetPlayers() []*HoldemPlayerGetPlayers プレイヤー一覧取得
func (h *Holdem) GetPot() intGetPot ポット取得
func (h *Holdem) GetPotOdds() float64GetPotOdds ポットオッズを返す (PreFlop-Riverフェーズのみ)
### func (*Holdem) GetRaiseCount
func (h *Holdem) GetRaiseCount() intGetRaiseCount 現在のレイズ回数取得
### func (*Holdem) GetRebuyCounts
func (h *Holdem) GetRebuyCounts() []intGetRebuyCounts プレイヤーごとのリバイ回数取得
### func (*Holdem) GetRebuyPhaseType
func (h *Holdem) GetRebuyPhaseType() intGetRebuyPhaseType リバイフェーズ種別取得
### func (*Holdem) GetRoundResults
func (h *Holdem) GetRoundResults() []HoldemResultGetRoundResults ラウンド結果取得
### func (*Holdem) GetSidePots
func (h *Holdem) GetSidePots() []HoldemSidePotGetSidePots サイドポット取得
### func (*Holdem) ImportProfile
func (h *Holdem) ImportProfile(data []byte) errorImportProfile JSONバイトからメタAIプロファイルをインポートする
### func (*Holdem) IsAddonAvailable
func (h *Holdem) IsAddonAvailable() boolIsAddonAvailable 人間プレイヤーがアドオン可能かどうか
### func (*Holdem) IsHumanTurn
func (h *Holdem) IsHumanTurn() boolIsHumanTurn 人間のターンかチェック
### func (*Holdem) IsMuckAvailable
func (h *Holdem) IsMuckAvailable() boolIsMuckAvailable 人間プレイヤーがマック可能かどうか
### func (*Holdem) IsRebuyAvailable
func (h *Holdem) IsRebuyAvailable() boolIsRebuyAvailable 人間プレイヤーがリバイ可能かどうか
### func (*Holdem) MarshalJSON
func (h *Holdem) MarshalJSON() ([]byte, error)MarshalJSON implements json.Marshaler.
func (h *Holdem) Muck() errorMuck 人間プレイヤーがハンドをマックする (公開せずに伏せる)
### func (*Holdem) PlayerAction
func (h *Holdem) PlayerAction(action, amount, humanPlayMs int) errorPlayerAction 人間プレイヤーのアクション実行 humanPlayMs: 迷い時間(ms, 0=計測なし)
func (h *Holdem) Rebuy() errorRebuy 人間プレイヤーがリバイを実行する
func (h *Holdem) Reset() errorReset ゲーム初期化
### func (*Holdem) ResetProfile
func (h *Holdem) ResetProfile()ResetProfile メタAIプロファイルをリセットする
func (h *Holdem) Resize(players []*HoldemPlayer)Resize プレイヤースライスを差し替え、プレイヤー数依存スライスを再初期化する
func (h *Holdem) SetConfig(cfg HoldemConfig)SetConfig 設定変更
func (h *Holdem) ShowHand() errorShowHand 人間プレイヤーがハンドを公開する
func (h *Holdem) SkipAddon() errorSkipAddon 人間プレイヤーがアドオンを辞退する
func (h *Holdem) SkipRebuy() errorSkipRebuy 人間プレイヤーがリバイを辞退する
### func (*Holdem) UnmarshalJSON
func (h *Holdem) UnmarshalJSON(data []byte) errorUnmarshalJSON implements json.Unmarshaler.
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() HoldemConfigDefaultHoldemConfig デフォルト設定
### func (HoldemConfig) Validate
func (c HoldemConfig) Validate() errorValidate 設定値のドメインバリデーション
HoldemCpuAction CPU行動記録
type HoldemCpuAction struct {
PlayerIdx int // プレイヤーインデックス
Action int // アクション
Amount int // 金額
}HoldemEquityResult エクイティ計算結果
type HoldemEquityResult struct {
Equity float64 // 勝率 (0.0 - 1.0)
HandOdds []HoldemHandOdds // 各ハンドランクの確率
}func CalcEquity(humanCards, communityCards []*Card, activePlayers, simulations int, rng *rand.Rand) HoldemEquityResultCalcEquity モンテカルロシミュレーションによるエクイティ計算 humanCards: 人間の手札, communityCards: コミュニティカード, activePlayers: アクティブ相手プレイヤー数, simulations: シミュレーション回数, rng: 乱数生成器 (nilの場合はグローバルrand使用)
func CalcOmahaEquity(humanCards, communityCards []*Card, activePlayers, simulations int, rng *rand.Rand) HoldemEquityResultCalcOmahaEquity モンテカルロシミュレーションによるオマハエクイティ計算 humanCards: 人間の手札(4枚), communityCards: コミュニティカード, activePlayers: アクティブ相手プレイヤー数, simulations: シミュレーション回数, rng: 乱数生成器 (nilの場合はグローバルrand使用)
func CalcShortDeckEquity(humanCards, communityCards []*Card, activePlayers, simulations int, rng *rand.Rand) HoldemEquityResultCalcShortDeckEquity モンテカルロシミュレーションによるショートデックエクイティ計算 humanCards: 人間の手札(2枚), communityCards: コミュニティカード, activePlayers: アクティブ相手プレイヤー数, simulations: シミュレーション回数, rng: 乱数生成器 (nilの場合はグローバルrand使用)
HoldemHandOdds 各ハンドランクの確率
type HoldemHandOdds struct {
HandRank int // ハンドランク
HandName string // ハンド名
Probability float64 // 確率 (0.0 - 1.0)
}HoldemPlayStyle CPUプレイスタイル
type HoldemPlayStyle intconst (
HoldemStyleTAG HoldemPlayStyle = iota // Tight-Aggressive
HoldemStyleLAP // Loose-Passive
HoldemStyleTAP // Tight-Passive
HoldemStyleLAG // Loose-Aggressive
HoldemStyleGTO // Game Theory Optimal
)func DefaultCpuStyles(tableSize int) []HoldemPlayStyleDefaultCpuStyles テーブルサイズに応じたCPUスタイルを返す
HoldemPlayer テキサスホールデムプレイヤークラス
type HoldemPlayer struct {
Player // 親クラス
ChipHolder // チップ管理
// contains filtered or unexported fields
}func NewHoldemPlayer(isHuman bool, style HoldemPlayStyle) *HoldemPlayerNewHoldemPlayer コンストラクタ
func NewPlayersForTable(tableSize int) []*HoldemPlayerNewPlayersForTable 指定されたテーブルサイズに応じたプレイヤースライスを生成する
### func (*HoldemPlayer) EvalBestHand
func (hp *HoldemPlayer) EvalBestHand(communityCards []*Card) intEvalBestHand コミュニティカードとホールカードからベスト5枚を評価
### func (*HoldemPlayer) GetAFDisplay
func (hp *HoldemPlayer) GetAFDisplay() stringGetAFDisplay AF表示文字列取得 (“-”=アクションなし, “∞”=コールなし, “X.X”=通常)
### func (*HoldemPlayer) GetBestHand
func (hp *HoldemPlayer) GetBestHand() []*CardGetBestHand ベストハンド取得
### func (*HoldemPlayer) GetComparisonCards
func (hp *HoldemPlayer) GetComparisonCards() []*CardGetComparisonCards ハンド比較用カード取得 (BettingPlayerインターフェース)
### func (*HoldemPlayer) GetIsHuman
func (hp *HoldemPlayer) GetIsHuman() boolGetIsHuman 人間フラグ取得
### func (*HoldemPlayer) GetPFR
func (hp *HoldemPlayer) GetPFR() intGetPFR PFR%取得 (0 if totalHands==0)
### func (*HoldemPlayer) GetPFRCount
func (hp *HoldemPlayer) GetPFRCount() intGetPFRCount PFR対象ハンド数取得
### func (*HoldemPlayer) GetPlayStyle
func (hp *HoldemPlayer) GetPlayStyle() HoldemPlayStyleGetPlayStyle プレイスタイル取得
### func (*HoldemPlayer) GetPlayStyleName
func (hp *HoldemPlayer) GetPlayStyleName() stringGetPlayStyleName プレイスタイル名取得
### func (*HoldemPlayer) GetPostFlopBetRaise
func (hp *HoldemPlayer) GetPostFlopBetRaise() intGetPostFlopBetRaise ポストフロップ ベット+レイズ回数取得
### func (*HoldemPlayer) GetPostFlopCall
func (hp *HoldemPlayer) GetPostFlopCall() intGetPostFlopCall ポストフロップ コール回数取得
### func (*HoldemPlayer) GetThreeBet
func (hp *HoldemPlayer) GetThreeBet() intGetThreeBet 3Bet%取得 (0 if threeBetOpportunity==0)
### func (*HoldemPlayer) GetThreeBetCount
func (hp *HoldemPlayer) GetThreeBetCount() intGetThreeBetCount 3Bet実行数取得
### func (*HoldemPlayer) GetThreeBetOpportunity
func (hp *HoldemPlayer) GetThreeBetOpportunity() intGetThreeBetOpportunity 3Bet機会数取得
### func (*HoldemPlayer) GetTotalHands
func (hp *HoldemPlayer) GetTotalHands() intGetTotalHands 総ハンド数取得
### func (*HoldemPlayer) GetVPIP
func (hp *HoldemPlayer) GetVPIP() intGetVPIP VPIP%取得 (0 if totalHands==0)
### func (*HoldemPlayer) GetVPIPCount
func (hp *HoldemPlayer) GetVPIPCount() intGetVPIPCount 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) errorUnmarshalJSON implements json.Unmarshaler.
HoldemResult ショーダウン結果
type HoldemResult struct {
PlayerIdx int // プレイヤーインデックス
HandRank int // ハンドランク
HandName string // ハンド名
BestHand []*Card // ベスト5枚
Kickers []int // キッカーカード値
WonAmount int // 獲得チップ
Mucked bool // マックしたかどうか
}HoldemSidePot サイドポット (共通SidePot型のエイリアス)
type HoldemSidePot = SidePotIndianPoker インディアンポーカークラス
type IndianPoker struct {
// contains filtered or unexported fields
}func NewIndianPoker(trumpCards *TrumpCards, players []*IndianPokerPlayer, config IndianPokerConfig) *IndianPokerNewIndianPoker コンストラクタ
### func (*IndianPoker) ExportProfile
func (ip *IndianPoker) ExportProfile() interface{}ExportProfile メタAIプロファイルをエクスポートする (プロファイルがない場合はnil)
### func (*IndianPoker) GetActedFlags
func (ip *IndianPoker) GetActedFlags() []boolGetActedFlags actedフラグ取得
### func (*IndianPoker) GetActionLog
func (ip *IndianPoker) GetActionLog() []*ActionLogEntryGetActionLog 棋譜を取得する
### func (*IndianPoker) GetConfig
func (ip *IndianPoker) GetConfig() IndianPokerConfigGetConfig 設定取得
### func (*IndianPoker) GetCpuActions
func (ip *IndianPoker) GetCpuActions() []IndianPokerCpuActionGetCpuActions CPU行動記録取得
### func (*IndianPoker) GetCurrentTurn
func (ip *IndianPoker) GetCurrentTurn() intGetCurrentTurn 現在のターン取得
### func (*IndianPoker) GetDealerIdx
func (ip *IndianPoker) GetDealerIdx() intGetDealerIdx ディーラーインデックス取得
### func (*IndianPoker) GetGameEndFlag
func (ip *IndianPoker) GetGameEndFlag() boolGetGameEndFlag ゲーム終了フラグ取得
### func (*IndianPoker) GetHandCount
func (ip *IndianPoker) GetHandCount() intGetHandCount ハンド数取得
### func (*IndianPoker) GetHumanProfile
func (ip *IndianPoker) GetHumanProfile() *IndianPokerHumanProfileGetHumanProfile メタAIプロファイル取得
### func (*IndianPoker) GetLastBet
func (ip *IndianPoker) GetLastBet() intGetLastBet 最後のベット取得
### func (*IndianPoker) GetLastCpuError
func (ip *IndianPoker) GetLastCpuError() errorGetLastCpuError 最後のCPUアクションエラー取得 (テスト・デバッグ用)
### func (*IndianPoker) GetMinRaise
func (ip *IndianPoker) GetMinRaise() intGetMinRaise 最小レイズ額取得
### func (*IndianPoker) GetPhase
func (ip *IndianPoker) GetPhase() intGetPhase フェーズ取得
### func (*IndianPoker) GetPlayer
func (ip *IndianPoker) GetPlayer(i int) *IndianPokerPlayerGetPlayer 指定プレイヤー取得
### func (*IndianPoker) GetPlayerCnt
func (ip *IndianPoker) GetPlayerCnt() intGetPlayerCnt プレイヤー数取得
### func (*IndianPoker) GetPlayers
func (ip *IndianPoker) GetPlayers() []*IndianPokerPlayerGetPlayers プレイヤー一覧取得
### func (*IndianPoker) GetPot
func (ip *IndianPoker) GetPot() intGetPot ポット取得
### func (*IndianPoker) GetRaiseCount
func (ip *IndianPoker) GetRaiseCount() intGetRaiseCount 現在のレイズ回数取得
### func (*IndianPoker) GetRoundResults
func (ip *IndianPoker) GetRoundResults() []IndianPokerResultGetRoundResults ラウンド結果取得
### func (*IndianPoker) GetSidePots
func (ip *IndianPoker) GetSidePots() []IndianPokerSidePotGetSidePots サイドポット取得
### func (*IndianPoker) ImportProfile
func (ip *IndianPoker) ImportProfile(data []byte) errorImportProfile JSONバイトからメタAIプロファイルをインポートする
### func (*IndianPoker) IsHumanTurn
func (ip *IndianPoker) IsHumanTurn() boolIsHumanTurn 人間のターンかチェック
### func (*IndianPoker) MarshalJSON
func (ip *IndianPoker) MarshalJSON() ([]byte, error)MarshalJSON implements json.Marshaler.
### func (*IndianPoker) PlayerAction
func (ip *IndianPoker) PlayerAction(action, amount, humanPlayMs int) errorPlayerAction 人間プレイヤーのアクション実行 humanPlayMs: 迷い時間(ms, 0=計測なし)
func (ip *IndianPoker) Reset() errorReset ゲーム初期化
### 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) errorUnmarshalJSON implements json.Unmarshaler.
IndianPokerConfig インディアンポーカー設定
type IndianPokerConfig struct {
Ante int // アンティ
InitChips int // 初期チップ
BettingLimit BettingLimitType // ベッティングリミット
CpuMetaAI bool // メタAI: セッション内学習
}### func DefaultIndianPokerConfig
func DefaultIndianPokerConfig() IndianPokerConfigDefaultIndianPokerConfig デフォルト設定
### func (IndianPokerConfig) Validate
func (c IndianPokerConfig) Validate() errorValidate 設定値のドメインバリデーション
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() float64AdaptStrength 適応強度を返す (0.0 ~ 0.2)
### func (*IndianPokerHumanProfile) AdjustedBluffChance
func (p *IndianPokerHumanProfile) AdjustedBluffChance(base float64) float64AdjustedBluffChance 人間のフォールド率に基づいて調整済みブラフ確率を返す 人間がフォールドしやすい → CPUがブラフを増やす
### func (*IndianPokerHumanProfile) AdjustedCallChance
func (p *IndianPokerHumanProfile) AdjustedCallChance(base float64, bracket int, hesitationMs int) float64AdjustedCallChance ブラフ率と迷い時間に基づいて調整済みコール確率を返す base: ベースコール確率, bracket: カード強度ブラケット, hesitationMs: 迷い時間(ms)
### func (*IndianPokerHumanProfile) BluffRate
func (p *IndianPokerHumanProfile) BluffRate(bracket int) float64BluffRate 指定ブラケットのアグレッシブ率を返す (データなしの場合0.5)
### func (*IndianPokerHumanProfile) Export
func (p *IndianPokerHumanProfile) Export() IndianPokerHumanProfileDataExport プロファイルデータをJSON永続化形式でエクスポートする
### func (*IndianPokerHumanProfile) FoldRate
func (p *IndianPokerHumanProfile) FoldRate() float64FoldRate フォールド率を返す (データなしの場合0.5)
### func (*IndianPokerHumanProfile) HesitationBoost
func (p *IndianPokerHumanProfile) HesitationBoost(ms int) float64HesitationBoost 指定msの迷い時間に対するコール確率ブーストを返す
### func (*IndianPokerHumanProfile) HesitationStdDev
func (p *IndianPokerHumanProfile) HesitationStdDev() float64HesitationStdDev 迷い時間の標準偏差を返す (データ不足の場合0)
### func (*IndianPokerHumanProfile) HesitationZScore
func (p *IndianPokerHumanProfile) HesitationZScore(ms int) float64HesitationZScore 指定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をデコードする
IndianPokerPlayer インディアンポーカープレイヤークラス
type IndianPokerPlayer struct {
Player // 親クラス
ChipHolder // チップ管理
// contains filtered or unexported fields
}func NewIndianPokerPlayer(isHuman bool, style HoldemPlayStyle) *IndianPokerPlayerNewIndianPokerPlayer コンストラクタ
### func NewIndianPokerPlayers
func NewIndianPokerPlayers() []*IndianPokerPlayerNewIndianPokerPlayers インディアンポーカーのプレイヤースライスを生成する (1 human + 3 CPU)
### func (*IndianPokerPlayer) GetComparisonCards
func (p *IndianPokerPlayer) GetComparisonCards() []*CardGetComparisonCards ハンド比較用カード取得 (BettingPlayerインターフェース)
### func (*IndianPokerPlayer) GetIsHuman
func (p *IndianPokerPlayer) GetIsHuman() boolGetIsHuman 人間フラグ取得
### func (*IndianPokerPlayer) GetPlayStyle
func (p *IndianPokerPlayer) GetPlayStyle() HoldemPlayStyleGetPlayStyle プレイスタイル取得
### func (*IndianPokerPlayer) GetPlayStyleName
func (p *IndianPokerPlayer) GetPlayStyleName() stringGetPlayStyleName プレイスタイル名取得
### func (*IndianPokerPlayer) MarshalJSON
func (p *IndianPokerPlayer) MarshalJSON() ([]byte, error)MarshalJSON implements json.Marshaler.
### func (*IndianPokerPlayer) UnmarshalJSON
func (p *IndianPokerPlayer) UnmarshalJSON(data []byte) errorUnmarshalJSON implements json.Unmarshaler.
IndianPokerResult ショーダウン結果
type IndianPokerResult struct {
PlayerIdx int // プレイヤーインデックス
Card *Card // 公開カード
CardRank int // カードランク (2-14, Ace=14)
WonAmount int // 獲得チップ
}IndianPokerSidePot サイドポット (共通SidePot型のエイリアス)
type IndianPokerSidePot = SidePotKlondike クロンダイクゲームクラス
type Klondike struct {
// contains filtered or unexported fields
}func NewKlondike(trumpCards *TrumpCards) *KlondikeNewKlondike コンストラクタ
### func (*Klondike) AllFaceUp
func (k *Klondike) AllFaceUp() boolAllFaceUp 全カードが表向きかどうか(ストックとウェイストも含む)
### func (*Klondike) AutoComplete
func (k *Klondike) AutoComplete() errorAutoComplete オートコンプリート(全カード表向きの場合に自動でファンデーションへ移動)
func (k *Klondike) CanUndo() boolCanUndo アンドゥ可能かどうか
func (k *Klondike) Draw() errorDraw ストックからウェイストにカードを引く
### func (*Klondike) GetActionLog
func (k *Klondike) GetActionLog() []*ActionLogEntryGetActionLog 棋譜取得
### func (*Klondike) GetDrawCount
func (k *Klondike) GetDrawCount() intGetDrawCount ドローカウント取得
### func (*Klondike) GetFoundation
func (k *Klondike) GetFoundation() [KlondikeFoundationCnt][]*CardGetFoundation ファンデーション取得
func (k *Klondike) GetHint() *KlondikeHintGetHint ヒントを取得
### func (*Klondike) GetMoveCount
func (k *Klondike) GetMoveCount() intGetMoveCount 移動回数取得
func (k *Klondike) GetPhase() KlondikePhaseGetPhase フェーズ取得
func (k *Klondike) GetScore() intGetScore スコア取得 (ベガス式: -52 + 5 * ファンデーション枚数)
### func (*Klondike) GetScoringMode
func (k *Klondike) GetScoringMode() KlondikeScoringModeGetScoringMode スコアリングモード取得
### func (*Klondike) GetStockCount
func (k *Klondike) GetStockCount() intGetStockCount ストック枚数取得
### func (*Klondike) GetTableau
func (k *Klondike) GetTableau() [KlondikeTableauCnt][]*KlondikeTableauCardGetTableau タブロー取得
func (k *Klondike) GetWaste() []*CardGetWaste ウェイスト取得
func (k *Klondike) GiveUp()GiveUp ギブアップ
### func (*Klondike) IsStalemate
func (k *Klondike) IsStalemate() boolIsStalemate 手詰まり状態取得
### func (*Klondike) MarshalJSON
func (k *Klondike) MarshalJSON() ([]byte, error)MarshalJSON implements json.Marshaler.
### func (*Klondike) MoveTableauToFoundation
func (k *Klondike) MoveTableauToFoundation(col int) errorMoveTableauToFoundation タブローからファンデーションにカードを移動
### func (*Klondike) MoveTableauToTableau
func (k *Klondike) MoveTableauToTableau(fromCol, cardIndex, toCol int) errorMoveTableauToTableau タブローからタブローにカードを移動
### func (*Klondike) MoveWasteToFoundation
func (k *Klondike) MoveWasteToFoundation() errorMoveWasteToFoundation ウェイストからファンデーションにカードを移動
### func (*Klondike) MoveWasteToTableau
func (k *Klondike) MoveWasteToTableau(col int) errorMoveWasteToTableau ウェイストからタブローにカードを移動
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 (k *Klondike) SetPhase(phase KlondikePhase)SetPhase フェーズ設定 (テスト用)
### func (*Klondike) SetScoringMode
func (k *Klondike) SetScoringMode(m KlondikeScoringMode)SetScoringMode スコアリングモード設定 (テスト用)
func (k *Klondike) SetStock(stock []*Card)SetStock ストック設定 (テスト用)
### func (*Klondike) SetTableau
func (k *Klondike) SetTableau(tableau [KlondikeTableauCnt][]*KlondikeTableauCard)SetTableau タブロー設定 (テスト用)
func (k *Klondike) SetWaste(waste []*Card)SetWaste ウェイスト設定 (テスト用)
func (k *Klondike) Undo() errorUndo 直前の操作を取り消す
func (k *Klondike) UndoN(n int) errorUndoN n回連続でアンドゥを実行する。
### func (*Klondike) UndoToEscape
func (k *Klondike) UndoToEscape() intUndoToEscape 膠着状態から抜けるために必要なアンドゥ回数を返す。膠着状態でなければ0、脱出不可なら-1。
### func (*Klondike) UnmarshalJSON
func (k *Klondike) UnmarshalJSON(data []byte) errorUnmarshalJSON implements json.Unmarshaler.
KlondikeConfig クロンダイクゲーム設定
type KlondikeConfig struct {
DrawCount int
ScoringMode KlondikeScoringMode
}KlondikeHint ヒント
type KlondikeHint struct {
FromZone string // "waste" or "tableau"
FromCol int
CardIndex int
ToZone string // "tableau" or "foundation"
ToCol int
}KlondikePhase クロンダイクゲームフェーズ
type KlondikePhase intconst (
// KlondikePhasePlaying プレイ中
KlondikePhasePlaying KlondikePhase = iota
// KlondikePhaseGameClear ゲームクリア
KlondikePhaseGameClear
// KlondikePhaseGameOver ゲームオーバー
KlondikePhaseGameOver
)KlondikeScoringMode スコアリングモード
type KlondikeScoringMode intconst (
// KlondikeScoringNone スコアリングなし
KlondikeScoringNone KlondikeScoringMode = iota
// KlondikeScoringVegas ベガススコアリング
KlondikeScoringVegas
)KlondikeTableauCard タブロー上のカード
type KlondikeTableauCard struct {
Card *Card `json:"c"`
FaceUp bool `json:"f"`
}Memory 神経衰弱ゲームクラス
type Memory struct {
// contains filtered or unexported fields
}func NewMemory(trumpCards *TrumpCards, players []*MemoryPlayer, config MemoryConfig) *MemoryNewMemory コンストラクタ
func (m *Memory) CpuFlip()CpuFlip CPUプレイヤーがカードをめくる (1ターン分: flip1 + flip2)
### func (*Memory) GetActionLog
func (m *Memory) GetActionLog() []*ActionLogEntryGetActionLog 棋譜取得
func (m *Memory) GetBoard() [MemoryBoardSize]*MemoryBoardCardGetBoard ボードカードを取得
### func (*Memory) GetBoardCard
func (m *Memory) GetBoardCard(pos int) *MemoryBoardCardGetBoardCard 指定位置のボードカードを取得
func (m *Memory) GetConfig() MemoryConfigGetConfig 設定を取得
### func (*Memory) GetCurrentPlayerIdx
func (m *Memory) GetCurrentPlayerIdx() intGetCurrentPlayerIdx 現在のプレイヤーインデックスを取得
### func (*Memory) GetFirstFlipPos
func (m *Memory) GetFirstFlipPos() intGetFirstFlipPos 1枚目のめくり位置を取得
### func (*Memory) GetGameEndFlag
func (m *Memory) GetGameEndFlag() boolGetGameEndFlag ゲーム終了フラグを取得
### func (*Memory) GetLastMatchResult
func (m *Memory) GetLastMatchResult() boolGetLastMatchResult 直前のマッチ結果を取得
func (m *Memory) GetPhase() MemoryPhaseGetPhase フェーズ取得
func (m *Memory) GetPlayer(i int) *MemoryPlayerGetPlayer プレイヤーを取得
### func (*Memory) GetPlayerCnt
func (m *Memory) GetPlayerCnt() intGetPlayerCnt プレイヤー数を取得
### func (*Memory) GetSecondFlipPos
func (m *Memory) GetSecondFlipPos() intGetSecondFlipPos 2枚目のめくり位置を取得
### func (*Memory) GetTurnNumber
func (m *Memory) GetTurnNumber() intGetTurnNumber ターン番号取得
### func (*Memory) GetWinnerIdx
func (m *Memory) GetWinnerIdx() intGetWinnerIdx 勝者インデックスを取得
### func (*Memory) IsHumanTurn
func (m *Memory) IsHumanTurn() boolIsHumanTurn 人間のターンかどうか
### func (*Memory) MarshalJSON
func (m *Memory) MarshalJSON() ([]byte, error)MarshalJSON implements json.Marshaler.
func (m *Memory) PlayerFlip(pos int) errorPlayerFlip 人間プレイヤーがカードをめくる
func (m *Memory) Reset()Reset ゲームリセット
### func (*Memory) ResolveFlip
func (m *Memory) ResolveFlip()ResolveFlip フリップ結果を解決する
func (m *Memory) SetBoard(board [MemoryBoardSize]*MemoryBoardCard)SetBoard ボード設定 (テスト用)
func (m *Memory) SetConfig(cfg MemoryConfig)SetConfig 設定を設定
### func (*Memory) SetCurrentPlayerIdx
func (m *Memory) SetCurrentPlayerIdx(idx int)SetCurrentPlayerIdx 現在のプレイヤーインデックスを設定 (テスト用)
func (m *Memory) SetPhase(phase MemoryPhase)SetPhase フェーズ設定 (テスト用)
### func (*Memory) UnmarshalJSON
func (m *Memory) UnmarshalJSON(data []byte) errorUnmarshalJSON implements json.Unmarshaler.
MemoryBoardCard ボード上のカード
type MemoryBoardCard struct {
Card *Card `json:"c"`
FaceUp bool `json:"f"`
Taken bool `json:"t"`
}MemoryConfig 神経衰弱ゲーム設定
type MemoryConfig struct {
CpuDifficulty MemoryCpuDifficulty `json:"cd"`
}func DefaultMemoryConfig() MemoryConfigDefaultMemoryConfig デフォルト設定を返す
MemoryCpuDifficulty CPU の難易度レベル
type MemoryCpuDifficulty intconst (
// MemoryCpuDifficultyEasy 低難易度
MemoryCpuDifficultyEasy MemoryCpuDifficulty = iota
// MemoryCpuDifficultyNormal 中難易度
MemoryCpuDifficultyNormal
// MemoryCpuDifficultyHard 高難易度
MemoryCpuDifficultyHard
)MemoryEntry turnSeen を持つ記憶エントリのインターフェース
type MemoryEntry interface {
GetTurnSeen() int
}MemoryPhase 神経衰弱ゲームフェーズ
type MemoryPhase intconst (
// MemoryPhaseFlip1 1枚目を選択するフェーズ
MemoryPhaseFlip1 MemoryPhase = iota
// MemoryPhaseFlip2 2枚目を選択するフェーズ
MemoryPhaseFlip2
// MemoryPhaseResult マッチ結果表示フェーズ
MemoryPhaseResult
// MemoryPhaseGameEnd ゲーム終了
MemoryPhaseGameEnd
)MemoryPlayer 神経衰弱プレイヤークラス
type MemoryPlayer struct {
*GamePlayer
// contains filtered or unexported fields
}func NewMemoryPlayer(isHuman bool) *MemoryPlayerNewMemoryPlayer コンストラクタ
### 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() intGetMemoryCount 記憶しているカード枚数を返す
### func (*MemoryPlayer) GetPairCount
func (p *MemoryPlayer) GetPairCount() intGetPairCount 獲得ペア数を取得
### func (*MemoryPlayer) GetPairs
func (p *MemoryPlayer) GetPairs() [][2]*CardGetPairs 獲得したペア一覧を取得
### 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) errorUnmarshalJSON implements json.Unmarshaler.
Napoleon ナポレオンゲームクラス
type Napoleon struct {
// contains filtered or unexported fields
}func NewNapoleon(trumpCards *TrumpCards, players []*NapoleonPlayer, config NapoleonConfig) *NapoleonNewNapoleon コンストラクタ
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 (n *Napoleon) CpuPlay()CpuPlay 現在の手番がCPUの場合に1ターン実行
### func (*Napoleon) GetActionLog
func (n *Napoleon) GetActionLog() []*ActionLogEntryGetActionLog 棋譜取得
### func (*Napoleon) GetAdjutantCard
func (n *Napoleon) GetAdjutantCard() *CardGetAdjutantCard 副官カード取得
### func (*Napoleon) GetAdjutantIdx
func (n *Napoleon) GetAdjutantIdx() intGetAdjutantIdx 副官インデックス取得
### func (*Napoleon) GetAdjutantRevealed
func (n *Napoleon) GetAdjutantRevealed() boolGetAdjutantRevealed 副官公開状態取得
### func (*Napoleon) GetBidPlayerIdx
func (n *Napoleon) GetBidPlayerIdx() intGetBidPlayerIdx ビッドプレイヤーインデックス取得
### func (*Napoleon) GetConfig
func (n *Napoleon) GetConfig() NapoleonConfigGetConfig 設定取得
### func (*Napoleon) GetCurrentPlayerIdx
func (n *Napoleon) GetCurrentPlayerIdx() intGetCurrentPlayerIdx 現在のプレイヤーインデックス取得
### func (*Napoleon) GetCurrentTrick
func (n *Napoleon) GetCurrentTrick() []*NapoleonTrickCardGetCurrentTrick 現在のトリック取得
### func (*Napoleon) GetGameEndFlag
func (n *Napoleon) GetGameEndFlag() boolGetGameEndFlag ゲーム終了フラグ取得
### func (*Napoleon) GetHighestBid
func (n *Napoleon) GetHighestBid() intGetHighestBid 現在の最高ビッド取得
### func (*Napoleon) GetHighestBidder
func (n *Napoleon) GetHighestBidder() intGetHighestBidder 最高ビッドプレイヤー取得
func (n *Napoleon) GetHint() *NapoleonHintGetHint ヒントを取得する
func (n *Napoleon) GetKitty() []*CardGetKitty 場札取得
### func (*Napoleon) GetLeadPlayerIdx
func (n *Napoleon) GetLeadPlayerIdx() intGetLeadPlayerIdx リードプレイヤーインデックス取得
### func (*Napoleon) GetNapoleonIdx
func (n *Napoleon) GetNapoleonIdx() intGetNapoleonIdx ナポレオンインデックス取得
### func (*Napoleon) GetPassCount
func (n *Napoleon) GetPassCount() intGetPassCount パス数取得
func (n *Napoleon) GetPhase() NapoleonPhaseGetPhase 現在のフェーズ取得
### func (*Napoleon) GetPlayer
func (n *Napoleon) GetPlayer(i int) *NapoleonPlayerGetPlayer プレイヤー取得
### func (*Napoleon) GetPlayerCnt
func (n *Napoleon) GetPlayerCnt() intGetPlayerCnt プレイヤー数取得
### func (*Napoleon) GetRoundNumber
func (n *Napoleon) GetRoundNumber() intGetRoundNumber 現在のラウンド番号取得
### func (*Napoleon) GetTrickNumber
func (n *Napoleon) GetTrickNumber() intGetTrickNumber 現在のトリック番号取得
### func (*Napoleon) GetTrumpSuit
func (n *Napoleon) GetTrumpSuit() intGetTrumpSuit 切り札スート取得
### func (*Napoleon) GetValidPlayIndices
func (n *Napoleon) GetValidPlayIndices(playerIdx int) []intGetValidPlayIndices プレイ可能なカードのインデックスリストを返す (Web用)
### func (*Napoleon) GetWinnerTeam
func (n *Napoleon) GetWinnerTeam() intGetWinnerTeam 勝利チーム取得 (-1 = 未確定)
### func (*Napoleon) IsHumanBidTurn
func (n *Napoleon) IsHumanBidTurn() boolIsHumanBidTurn 現在のビッド手番が人間かどうか
### func (*Napoleon) IsHumanDeclareTurn
func (n *Napoleon) IsHumanDeclareTurn() boolIsHumanDeclareTurn 切り札宣言が人間の番かどうか
### func (*Napoleon) IsHumanExchangeTurn
func (n *Napoleon) IsHumanExchangeTurn() boolIsHumanExchangeTurn 場札交換が人間の番かどうか
### func (*Napoleon) IsHumanTurn
func (n *Napoleon) IsHumanTurn() boolIsHumanTurn 現在の手番が人間かどうか
### 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) errorPlayerBid 人間プレイヤーがビッドする (0 = パス)
### func (*Napoleon) PlayerDeclareTrump
func (n *Napoleon) PlayerDeclareTrump(suit int, adjSuit int, adjVal int) errorPlayerDeclareTrump 人間プレイヤーが切り札と副官を宣言する
### func (*Napoleon) PlayerExchangeKitty
func (n *Napoleon) PlayerExchangeKitty(discardIndex int) errorPlayerExchangeKitty 人間ナポレオンが場札を交換する (捨てるカードのインデックス指定)
### func (*Napoleon) PlayerPlay
func (n *Napoleon) PlayerPlay(cardIndex int) errorPlayerPlay 人間プレイヤーがカードをプレイする
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 (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 (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) errorUnmarshalJSON implements json.Unmarshaler.
NapoleonConfig ナポレオンゲーム設定
type NapoleonConfig struct {
CpuDifficulty NapoleonCpuDifficulty
MinBid int // 最低ビッド値 (デフォルト12)
PointLimit int // ゲーム終了スコア (先に到達したプレイヤーが勝利)
}### func DefaultNapoleonConfig
func DefaultNapoleonConfig() NapoleonConfigDefaultNapoleonConfig デフォルト設定を返す
### func (NapoleonConfig) MarshalJSON
func (c NapoleonConfig) MarshalJSON() ([]byte, error)MarshalJSON implements json.Marshaler.
### func (*NapoleonConfig) UnmarshalJSON
func (c *NapoleonConfig) UnmarshalJSON(data []byte) errorUnmarshalJSON implements json.Unmarshaler.
### func (NapoleonConfig) Validate
func (c NapoleonConfig) Validate() errorValidate 設定値のドメインバリデーション
NapoleonCpuDifficulty CPU の難易度レベル
type NapoleonCpuDifficulty intconst (
// NapoleonCpuDifficultyEasy 低難易度
NapoleonCpuDifficultyEasy NapoleonCpuDifficulty = iota
// NapoleonCpuDifficultyNormal 中難易度
NapoleonCpuDifficultyNormal
// NapoleonCpuDifficultyHard 高難易度
NapoleonCpuDifficultyHard
)NapoleonHint ヒント情報
type NapoleonHint struct {
CardIndex *int // 推奨カードインデックス
Bid *int // 推奨ビッド値
TrumpSuit *int // 推奨切り札スート
AdjutantSuit *int // 推奨副官カードスート
AdjutantValue *int // 推奨副官カード値
DiscardIndex *int // 推奨捨てカードインデックス
Reason string // ヒント理由キー
}NapoleonPhase ゲームフェーズ
type NapoleonPhase intconst (
// 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
)NapoleonPlayer ナポレオンプレイヤークラス
type NapoleonPlayer struct {
*GamePlayer
RoundScoreHolder
TrickHolder
// contains filtered or unexported fields
}func NewNapoleonPlayer(isHuman bool) *NapoleonPlayerNewNapoleonPlayer コンストラクタ
### func (*NapoleonPlayer) GetAdjutantRevealed
func (p *NapoleonPlayer) GetAdjutantRevealed() boolGetAdjutantRevealed 副官公開状態
### func (*NapoleonPlayer) GetBid
func (p *NapoleonPlayer) GetBid() intGetBid ビッド取得 (-1 = 未ビッド, 0 = パス)
### func (*NapoleonPlayer) GetIsAdjutant
func (p *NapoleonPlayer) GetIsAdjutant() boolGetIsAdjutant 副官かどうか
### func (*NapoleonPlayer) GetIsNapoleon
func (p *NapoleonPlayer) GetIsNapoleon() boolGetIsNapoleon ナポレオンかどうか
### func (*NapoleonPlayer) GetPictureCards
func (p *NapoleonPlayer) GetPictureCards() intGetPictureCards 獲得した絵札数
### 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) errorUnmarshalJSON implements json.Unmarshaler.
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) errorUnmarshalJSON implements json.Unmarshaler.
OhHell オー・ヘルゲームクラス
type OhHell struct {
// contains filtered or unexported fields
}func NewOhHell(trumpCards *TrumpCards, players []*OhHellPlayer, config OhHellConfig) *OhHellNewOhHell コンストラクタ
func (o *OhHell) CpuBid()CpuBid 現在のビッドプレイヤーがCPUの場合にビッドする
func (o *OhHell) CpuPlay()CpuPlay 現在の手番がCPUの場合に1ターン実行
### func (*OhHell) GetActionLog
func (o *OhHell) GetActionLog() []*ActionLogEntryGetActionLog 棋譜取得
### func (*OhHell) GetBidPlayerIdx
func (o *OhHell) GetBidPlayerIdx() intGetBidPlayerIdx ビッドプレイヤーインデックス取得
func (o *OhHell) GetConfig() OhHellConfigGetConfig 設定取得
### func (*OhHell) GetCurrentPlayerIdx
func (o *OhHell) GetCurrentPlayerIdx() intGetCurrentPlayerIdx 現在のプレイヤーインデックス取得
### func (*OhHell) GetCurrentTrick
func (o *OhHell) GetCurrentTrick() []*OhHellTrickCardGetCurrentTrick 現在のトリック取得
### func (*OhHell) GetDealerIdx
func (o *OhHell) GetDealerIdx() intGetDealerIdx ディーラーインデックス取得
### func (*OhHell) GetGameEndFlag
func (o *OhHell) GetGameEndFlag() boolGetGameEndFlag ゲーム終了フラグ取得
### func (*OhHell) GetHandSize
func (o *OhHell) GetHandSize() intGetHandSize 現在のラウンドの手札枚数取得
func (o *OhHell) GetHint() *OhHellHintGetHint ヒントを取得する
### func (*OhHell) GetLeadPlayerIdx
func (o *OhHell) GetLeadPlayerIdx() intGetLeadPlayerIdx リードプレイヤーインデックス取得
func (o *OhHell) GetPhase() OhHellPhaseGetPhase 現在のフェーズ取得
func (o *OhHell) GetPlayer(i int) *OhHellPlayerGetPlayer プレイヤー取得
### func (*OhHell) GetPlayerCnt
func (o *OhHell) GetPlayerCnt() intGetPlayerCnt プレイヤー数取得
### func (*OhHell) GetRestrictedBid
func (o *OhHell) GetRestrictedBid() intGetRestrictedBid ディーラーが選択できないビッド値を返す (-1 = 制限なし)
### func (*OhHell) GetRoundNumber
func (o *OhHell) GetRoundNumber() intGetRoundNumber 現在のラ���ンド番号取得
### func (*OhHell) GetTotalRounds
func (o *OhHell) GetTotalRounds() intGetTotalRounds 総ラウンド数取得
### func (*OhHell) GetTrickNumber
func (o *OhHell) GetTrickNumber() intGetTrickNumber 現在のトリック番号取得
### func (*OhHell) GetTrumpCard
func (o *OhHell) GetTrumpCard() *CardGetTrumpCard 切り札カード取得
### func (*OhHell) GetTrumpSuit
func (o *OhHell) GetTrumpSuit() intGetTrumpSuit 切り札スート取得 (-1 = 切り札なし)
### func (*OhHell) GetValidPlayIndices
func (o *OhHell) GetValidPlayIndices(playerIdx int) []intGetValidPlayIndices プレイ可���なカードのインデックスリストを返す
### func (*OhHell) GetWinnerIdx
func (o *OhHell) GetWinnerIdx() intGetWinnerIdx 勝者インデックス取得 (-1 = 未確定)
### func (*OhHell) IsHumanBidTurn
func (o *OhHell) IsHumanBidTurn() boolIsHumanBidTurn 現在のビッド手番が人間かどうか
### func (*OhHell) IsHumanTurn
func (o *OhHell) IsHumanTurn() boolIsHumanTurn 現在の手番が人間かどうか
### func (*OhHell) MarshalJSON
func (o *OhHell) MarshalJSON() ([]byte, error)MarshalJSON implements json.Marshaler.
func (o *OhHell) NextRound()NextRound 次のラウンドを開始する
func (o *OhHell) NextTrick()NextTrick 次のトリックを開始する
func (o *OhHell) PlayerBid(bid int) errorPlayerBid 人間プレイヤーがビッドする
func (o *OhHell) PlayerPlay(cardIndex int) errorPlayerPlay 人間プレイヤーがカードをプレイする
func (o *OhHell) Reset()Reset ゲーム初期化
### func (*OhHell) ResolveTrick
func (o *OhHell) ResolveTrick()ResolveTrick トリックを解決して勝者を決定する
func (o *OhHell) ScoreRound()ScoreRound ラウンドのスコアを確定し、ゲーム終了判定を行う
### func (*OhHell) SetBidPlayerIdx
func (o *OhHell) SetBidPlayerIdx(idx int)SetBidPlayerIdx ビッドプレイヤーインデックス設定 (テスト用)
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 (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) errorUnmarshalJSON implements json.Unmarshaler.
OhHellConfig オー・ヘルゲーム設定
type OhHellConfig struct {
CpuDifficulty OhHellCpuDifficulty `json:"cd"`
MaxHandSize int `json:"mh"` // 最大手札枚数 (デフォルト10)
ScoringVariant OhHellScoringVariant `json:"sv"`
RoundDirection OhHellRoundDirection `json:"rd"`
}func DefaultOhHellConfig() OhHellConfigDefaultOhHellConfig デフォルト設定を返す
### func (OhHellConfig) Validate
func (c OhHellConfig) Validate() errorValidate 設定値のドメインバリデーション
OhHellCpuDifficulty CPU の難易度レベル
type OhHellCpuDifficulty intconst (
// OhHellCpuDifficultyEasy 低難易度
OhHellCpuDifficultyEasy OhHellCpuDifficulty = iota
// OhHellCpuDifficultyNormal 中難易度
OhHellCpuDifficultyNormal
// OhHellCpuDifficultyHard 高難易度
OhHellCpuDifficultyHard
)OhHellHint ヒント情報
type OhHellHint struct {
CardIndex *int // 推奨カードインデックス (ビッド時nil)
Bid *int // 推奨ビッド値 (プレイ時nil)
Reason string // ヒント理由キー
}OhHellPhase ゲームフェーズ
type OhHellPhase intconst (
// OhHellPhaseBid ビッドフェーズ
OhHellPhaseBid OhHellPhase = 0
// OhHellPhasePlay トリックプレイフェーズ
OhHellPhasePlay OhHellPhase = 1
// OhHellPhaseTrickEnd トリック終了フェーズ
OhHellPhaseTrickEnd OhHellPhase = 2
// OhHellPhaseRoundEnd ラウンド終了フェーズ
OhHellPhaseRoundEnd OhHellPhase = 3
// OhHellPhaseGameEnd ゲーム終了フェーズ
OhHellPhaseGameEnd OhHellPhase = 4
)OhHellPlayer オー・ヘルプレイヤークラス
type OhHellPlayer struct {
*GamePlayer
RoundScoreHolder
TrickHolder
// contains filtered or unexported fields
}func NewOhHellPlayer(isHuman bool) *OhHellPlayerNewOhHellPlayer コンストラクタ
### func (*OhHellPlayer) GetBid
func (p *OhHellPlayer) GetBid() intGetBid ビッド取得 (-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) errorUnmarshalJSON implements json.Unmarshaler.
OhHellRoundDirection ラウンド進行方向
type OhHellRoundDirection intconst (
// OhHellRoundDownOnly 手札枚数が減少のみ (max→1)
OhHellRoundDownOnly OhHellRoundDirection = iota
// OhHellRoundDownAndUp 手札枚数が減少後増加 (max→1→max)
OhHellRoundDownAndUp
)OhHellScoringVariant スコアリング方式
type OhHellScoringVariant intconst (
// OhHellScoringStandard 正確なビッド = 10+bid, 外れ = 0
OhHellScoringStandard OhHellScoringVariant = iota
// OhHellScoringPenalty 正確なビッド = 10+bid, 外れ = -|差分|
OhHellScoringPenalty
)OhHellTrickCard トリック中の1枚
type OhHellTrickCard struct {
PlayerIdx int `json:"pi"`
Card *Card `json:"c"`
}OldMaid ババ抜きゲームクラス
type OldMaid struct {
// contains filtered or unexported fields
}func NewOldMaid(trumpCards *TrumpCards, players []*OldMaidPlayer) *OldMaidNewOldMaid コンストラクタ
### func (*OldMaid) ArrangeTargetForHumanDraw
func (o *OldMaid) ArrangeTargetForHumanDraw()ArrangeTargetForHumanDraw CPU心理戦: 人間が引く前に対象CPUの奇数カードを端に配置する
func (o *OldMaid) CpuDraw() errorCpuDraw 現在の手番がCPUの場合に1ターン実行
### func (*OldMaid) ExportProfile
func (o *OldMaid) ExportProfile() interface{}ExportProfile メタAIプロファイルをエクスポートする (プロファイルがない場合はnil)
### func (*OldMaid) GetActionLog
func (o *OldMaid) GetActionLog() []*ActionLogEntryGetActionLog 棋譜を取得する
func (o *OldMaid) GetConfig() OldMaidConfigGetConfig ゲーム設定取得
### func (*OldMaid) GetCpuActions
func (o *OldMaid) GetCpuActions() []*OldMaidCpuActionGetCpuActions CPUターンの行動履歴取得
### func (*OldMaid) GetCpuHighlightedCardIdx
func (o *OldMaid) GetCpuHighlightedCardIdx() intGetCpuHighlightedCardIdx CPU心理戦で強調された奇数カードの位置取得 (-1=なし)
### func (*OldMaid) GetCurrentTurn
func (o *OldMaid) GetCurrentTurn() intGetCurrentTurn 現在の手番プレイヤーインデックス取得
### func (*OldMaid) GetDrawHistory
func (o *OldMaid) GetDrawHistory() []*OldMaidDrawHistoryEntryGetDrawHistory ゲーム全体の引き履歴取得
### func (*OldMaid) GetGameEndFlag
func (o *OldMaid) GetGameEndFlag() boolGetGameEndFlag ゲーム終了フラグ取得
### func (*OldMaid) GetHasDrawn
func (o *OldMaid) GetHasDrawn() boolGetHasDrawn 引きが発生したかどうか
### func (*OldMaid) GetHumanAction
func (o *OldMaid) GetHumanAction() *OldMaidCpuActionGetHumanAction 人間プレイヤーの最後の行動記録取得
### func (*OldMaid) GetHumanHandDirty
func (o *OldMaid) GetHumanHandDirty() boolGetHumanHandDirty 人間がシャッフル/並び替えしたか
### func (*OldMaid) GetHumanProfile
func (o *OldMaid) GetHumanProfile() *OldMaidHumanProfileGetHumanProfile メタAIプロファイル取得
### func (*OldMaid) GetLastDiscardedCards
func (o *OldMaid) GetLastDiscardedCards() []*CardGetLastDiscardedCards 最後に捨てたカード取得
### func (*OldMaid) GetLastDiscardedPairs
func (o *OldMaid) GetLastDiscardedPairs() intGetLastDiscardedPairs 最後に捨てたペア数
### func (*OldMaid) GetLastDrawCard
func (o *OldMaid) GetLastDrawCard() *CardGetLastDrawCard 最後に引いたカード
### func (*OldMaid) GetLastDrawFromIdx
func (o *OldMaid) GetLastDrawFromIdx() intGetLastDrawFromIdx 最後に引いた相手のインデックス
### func (*OldMaid) GetLastDrawPlayerIdx
func (o *OldMaid) GetLastDrawPlayerIdx() intGetLastDrawPlayerIdx 最後に引いたプレイヤーのインデックス
### func (*OldMaid) GetLoserIdx
func (o *OldMaid) GetLoserIdx() intGetLoserIdx 負けプレイヤーインデックス取得
### func (*OldMaid) GetNextDrawTargetIdx
func (o *OldMaid) GetNextDrawTargetIdx() intGetNextDrawTargetIdx 現在の手番プレイヤーが引く相手のインデックス取得
func (o *OldMaid) GetPlayer(idx int) *OldMaidPlayerGetPlayer プレイヤー取得
### func (*OldMaid) GetPlayerCnt
func (o *OldMaid) GetPlayerCnt() intGetPlayerCnt プレイヤー数取得
### func (*OldMaid) GetRemovedCard
func (o *OldMaid) GetRemovedCard() *CardGetRemovedCard ジジ抜きで除外されたカード取得
### func (*OldMaid) ImportProfile
func (o *OldMaid) ImportProfile(data []byte) errorImportProfile JSONバイトからメタAIプロファイルをインポートする
### func (*OldMaid) IsHumanTurn
func (o *OldMaid) IsHumanTurn() boolIsHumanTurn 現在の手番が人間かどうか
### func (*OldMaid) MarshalJSON
func (o *OldMaid) MarshalJSON() ([]byte, error)MarshalJSON implements json.Marshaler.
### func (*OldMaid) PlayerDraw
func (o *OldMaid) PlayerDraw(cardIdx int) errorPlayerDraw 人間プレイヤーがカードを引く cardIdx: 引くカードのインデックス。-1 の場合はランダム選択。
### func (*OldMaid) ReorderHumanHand
func (o *OldMaid) ReorderHumanHand(indices []int) errorReorderHumanHand 人間プレイヤーの手札を指定された順番に並び替える
func (o *OldMaid) Reset()Reset ゲーム初期化
### func (*OldMaid) ResetProfile
func (o *OldMaid) ResetProfile()ResetProfile メタAIプロファイルをリセットする
func (o *OldMaid) SetConfig(config OldMaidConfig)SetConfig ゲーム設定をセット
### func (*OldMaid) ShuffleHumanHand
func (o *OldMaid) ShuffleHumanHand() errorShuffleHumanHand 人間プレイヤーの手札をシャッフルする
### func (*OldMaid) UnmarshalJSON
func (o *OldMaid) UnmarshalJSON(data []byte) errorUnmarshalJSON implements json.Unmarshaler.
OldMaidConfig ババ抜き設定
type OldMaidConfig struct {
Mode OldMaidMode
CpuPlacementStrategy bool // CPU心理戦: 奇数カードを端に配置
CpuMemoryAI bool // CPU記憶AI: 引いた位置を記憶して戦略的に選択
CpuHesitationEnabled bool // CPU迷い時間ディレイ
CpuMetaAI bool // メタAI: セッション内学習
}func DefaultOldMaidConfig() OldMaidConfigDefaultOldMaidConfig デフォルト設定を返す
### func (OldMaidConfig) MarshalJSON
func (c OldMaidConfig) MarshalJSON() ([]byte, error)MarshalJSON implements json.Marshaler.
### func (*OldMaidConfig) UnmarshalJSON
func (c *OldMaidConfig) UnmarshalJSON(data []byte) errorUnmarshalJSON implements json.Unmarshaler.
### func (OldMaidConfig) Validate
func (c OldMaidConfig) Validate() errorValidate 設定値のドメインバリデーション
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) errorUnmarshalJSON 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) errorUnmarshalJSON implements json.Unmarshaler.
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() float64AdaptStrength 適応強度を返す (0.0 ~ 0.2)
### func (*OldMaidHumanProfile) Export
func (p *OldMaidHumanProfile) Export() OldMaidHumanProfileDataExport プロファイルデータをJSON永続化形式でエクスポートする
### func (*OldMaidHumanProfile) Import
func (p *OldMaidHumanProfile) Import(data OldMaidHumanProfileData)Import JSON永続化形式のデータからプロファイルを復元する
### func (*OldMaidHumanProfile) PickRate
func (p *OldMaidHumanProfile) PickRate(bucket int) float64PickRate 指定バケットのピック率を返す (データなしの場合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() float64ShuffleRate シャッフル率を返す (draws == 0 の場合0.0)
### func (*OldMaidHumanProfile) StrategicPlacement
func (p *OldMaidHumanProfile) StrategicPlacement(size int) intStrategicPlacement 奇数カードの戦略的配置位置を返す 最もピックされにくいゾーンに配置する。 適応強度が低い場合やシャッフル率が高い場合はランダムな端に配置する。
## 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をデコードする
OldMaidMode ババ抜きモード
type OldMaidMode intconst (
OldMaidModeNormal OldMaidMode = iota // ババ抜き: ジョーカーが奇数カード
OldMaidModeJijiNuki // ジジ抜き: ランダム1枚除外
)OldMaidPlayer ババ抜きプレイヤークラス
type OldMaidPlayer struct {
*GamePlayer
// contains filtered or unexported fields
}func NewOldMaidPlayer(isHuman bool) *OldMaidPlayerNewOldMaidPlayer コンストラクタ
### func (*OldMaidPlayer) DiscardPairs
func (p *OldMaidPlayer) DiscardPairs() ([]*Card, int)DiscardPairs ペアのカードを捨てる (捨てたカードとペア数を返す)
### func (*OldMaidPlayer) GetMemGotPair
func (p *OldMaidPlayer) GetMemGotPair() boolGetMemGotPair 最後に引いたカードでペアができたか取得
### func (*OldMaidPlayer) GetMemLastDrawPos
func (p *OldMaidPlayer) GetMemLastDrawPos() intGetMemLastDrawPos 最後に引いたカードの位置取得
### 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) errorUnmarshalJSON implements json.Unmarshaler.
Omaha オマハホールデムクラス
type Omaha struct {
// contains filtered or unexported fields
}func NewOmaha(trumpCards *TrumpCards, players []*OmahaPlayer, config OmahaConfig) *OmahaNewOmaha コンストラクタ
func (o *Omaha) Addon() errorAddon 人間プレイヤーがアドオンを実行する
### func (*Omaha) ExportProfile
func (o *Omaha) ExportProfile() interface{}ExportProfile メタAIプロファイルをエクスポートする (プロファイルがない場合はnil)
### func (*Omaha) GetActedFlags
func (o *Omaha) GetActedFlags() []boolGetActedFlags actedフラグ取得
### func (*Omaha) GetActionLog
func (o *Omaha) GetActionLog() []*ActionLogEntryGetActionLog 棋譜を取得する
### func (*Omaha) GetAddonUsed
func (o *Omaha) GetAddonUsed() []boolGetAddonUsed プレイヤーごとのアドオン使用フラグ取得
### func (*Omaha) GetCommunityCards
func (o *Omaha) GetCommunityCards() []*CardGetCommunityCards コミュニティカード取得
func (o *Omaha) GetConfig() OmahaConfigGetConfig 設定取得
### func (*Omaha) GetCpuActions
func (o *Omaha) GetCpuActions() []OmahaCpuActionGetCpuActions CPU行動記録取得
### func (*Omaha) GetCurrentTurn
func (o *Omaha) GetCurrentTurn() intGetCurrentTurn 現在のターン取得
### func (*Omaha) GetDealerIdx
func (o *Omaha) GetDealerIdx() intGetDealerIdx ディーラーインデックス取得
func (o *Omaha) GetEquity() *HoldemEquityResultGetEquity エクイティ計算結果を返す
### func (*Omaha) GetGameEndFlag
func (o *Omaha) GetGameEndFlag() boolGetGameEndFlag ゲーム終了フラグ取得
### func (*Omaha) GetHandCount
func (o *Omaha) GetHandCount() intGetHandCount ハンド数取得
### func (*Omaha) GetHumanProfile
func (o *Omaha) GetHumanProfile() *BettingHumanProfileGetHumanProfile メタAIプロファイル取得
func (o *Omaha) GetLastBet() intGetLastBet 最後のベット取得
### func (*Omaha) GetLastCpuError
func (o *Omaha) GetLastCpuError() errorGetLastCpuError 最後のCPUアクションエラー取得
func (o *Omaha) GetMinRaise() intGetMinRaise 最小レイズ額取得
func (o *Omaha) GetPhase() intGetPhase フェーズ取得
func (o *Omaha) GetPlayer(i int) *OmahaPlayerGetPlayer 指定プレイヤー取得
### func (*Omaha) GetPlayerCnt
func (o *Omaha) GetPlayerCnt() intGetPlayerCnt プレイヤー数取得
func (o *Omaha) GetPlayers() []*OmahaPlayerGetPlayers プレイヤー一覧取得
func (o *Omaha) GetPot() intGetPot ポット取得
func (o *Omaha) GetPotOdds() float64GetPotOdds ポットオッズを返す
### func (*Omaha) GetRaiseCount
func (o *Omaha) GetRaiseCount() intGetRaiseCount 現在のレイズ回数取得
### func (*Omaha) GetRebuyCounts
func (o *Omaha) GetRebuyCounts() []intGetRebuyCounts プレイヤーごとのリバイ回数取得
### func (*Omaha) GetRebuyPhaseType
func (o *Omaha) GetRebuyPhaseType() intGetRebuyPhaseType リバイフェーズ種別取得
### func (*Omaha) GetRoundResults
func (o *Omaha) GetRoundResults() []OmahaResultGetRoundResults ラウンド結果取得
func (o *Omaha) GetSidePots() []OmahaSidePotGetSidePots サイドポット取得
### func (*Omaha) ImportProfile
func (o *Omaha) ImportProfile(data []byte) errorImportProfile JSONバイトからメタAIプロファイルをインポートする
### func (*Omaha) IsAddonAvailable
func (o *Omaha) IsAddonAvailable() boolIsAddonAvailable 人間プレイヤーがアドオン可能かどうか
func (o *Omaha) IsHumanTurn() boolIsHumanTurn 人間のターンかチェック
### func (*Omaha) IsMuckAvailable
func (o *Omaha) IsMuckAvailable() boolIsMuckAvailable 人間プレイヤーがマック可能かどうか
### func (*Omaha) IsRebuyAvailable
func (o *Omaha) IsRebuyAvailable() boolIsRebuyAvailable 人間プレイヤーがリバイ可能かどうか
func (o *Omaha) MarshalJSON() ([]byte, error)MarshalJSON implements json.Marshaler.
func (o *Omaha) Muck() errorMuck 人間プレイヤーがハンドをマックする
### func (*Omaha) PlayerAction
func (o *Omaha) PlayerAction(action, amount, humanPlayMs int) errorPlayerAction 人間プレイヤーのアクション実行 humanPlayMs: 迷い時間(ms, 0=計測なし)
func (o *Omaha) Rebuy() errorRebuy 人間プレイヤーがリバイを実行する
func (o *Omaha) Reset() errorReset ゲーム初期化
### func (*Omaha) ResetProfile
func (o *Omaha) ResetProfile()ResetProfile メタAIプロファイルをリセットする
func (o *Omaha) Resize(players []*OmahaPlayer)Resize プレイヤースライスを差し替え、プレイヤー数依存スライスを再初期化する
func (o *Omaha) SetConfig(cfg OmahaConfig)SetConfig 設定変更
func (o *Omaha) ShowHand() errorShowHand 人間プレイヤーがハンドを公開する
func (o *Omaha) SkipAddon() errorSkipAddon 人間プレイヤーがアドオンを辞退する
func (o *Omaha) SkipRebuy() errorSkipRebuy 人間プレイヤーがリバイを辞退する
### func (*Omaha) UnmarshalJSON
func (o *Omaha) UnmarshalJSON(data []byte) errorUnmarshalJSON implements json.Unmarshaler.
OmahaConfig オマハホールデム設定 (HoldemConfigと同一構造)
type OmahaConfig = HoldemConfigfunc DefaultOmahaConfig() OmahaConfigDefaultOmahaConfig デフォルト設定
OmahaCpuAction CPU行動記録
type OmahaCpuAction = HoldemCpuActionOmahaPlayStyle CPUプレイスタイル (HoldemPlayStyleと同一)
type OmahaPlayStyle = HoldemPlayStyleOmahaPlayer オマハホールデムプレイヤークラス
type OmahaPlayer struct {
Player // 親クラス
ChipHolder // チップ管理
// contains filtered or unexported fields
}func NewOmahaPlayer(isHuman bool, style HoldemPlayStyle) *OmahaPlayerNewOmahaPlayer コンストラクタ
### func NewOmahaPlayersForTable
func NewOmahaPlayersForTable(tableSize int) []*OmahaPlayerNewOmahaPlayersForTable 指定されたテーブルサイズに応じたオマハプレイヤースライスを生成する
### func (*OmahaPlayer) EvalBestHand
func (op *OmahaPlayer) EvalBestHand(communityCards []*Card) intEvalBestHand コミュニティカードとホールカード(4枚)からベスト5枚を評価 オマハルール: ホールカードから必ず2枚、コミュニティカードから必ず3枚を使う
### func (*OmahaPlayer) GetAFDisplay
func (op *OmahaPlayer) GetAFDisplay() stringGetAFDisplay AF表示文字列取得 (“-”=アクションなし, “∞”=コールなし, “X.X”=通常)
### func (*OmahaPlayer) GetBestHand
func (op *OmahaPlayer) GetBestHand() []*CardGetBestHand ベストハンド取得
### func (*OmahaPlayer) GetComparisonCards
func (op *OmahaPlayer) GetComparisonCards() []*CardGetComparisonCards ハンド比較用カード取得 (BettingPlayerインターフェース)
### func (*OmahaPlayer) GetIsHuman
func (op *OmahaPlayer) GetIsHuman() boolGetIsHuman 人間フラグ取得
### func (*OmahaPlayer) GetPFR
func (op *OmahaPlayer) GetPFR() intGetPFR PFR%取得 (0 if totalHands==0)
### func (*OmahaPlayer) GetPFRCount
func (op *OmahaPlayer) GetPFRCount() intGetPFRCount PFR対象ハンド数取得
### func (*OmahaPlayer) GetPlayStyle
func (op *OmahaPlayer) GetPlayStyle() HoldemPlayStyleGetPlayStyle プレイスタイル取得
### func (*OmahaPlayer) GetPlayStyleName
func (op *OmahaPlayer) GetPlayStyleName() stringGetPlayStyleName プレイスタイル名取得
### func (*OmahaPlayer) GetPostFlopBetRaise
func (op *OmahaPlayer) GetPostFlopBetRaise() intGetPostFlopBetRaise ポストフロップ ベット+レイズ回数取得
### func (*OmahaPlayer) GetPostFlopCall
func (op *OmahaPlayer) GetPostFlopCall() intGetPostFlopCall ポストフロップ コール回数取得
### func (*OmahaPlayer) GetThreeBet
func (op *OmahaPlayer) GetThreeBet() intGetThreeBet 3Bet%取得 (0 if threeBetOpportunity==0)
### func (*OmahaPlayer) GetThreeBetCount
func (op *OmahaPlayer) GetThreeBetCount() intGetThreeBetCount 3Bet実行数取得
### func (*OmahaPlayer) GetThreeBetOpportunity
func (op *OmahaPlayer) GetThreeBetOpportunity() intGetThreeBetOpportunity 3Bet機会数取得
### func (*OmahaPlayer) GetTotalHands
func (op *OmahaPlayer) GetTotalHands() intGetTotalHands 総ハンド数取得
### func (*OmahaPlayer) GetVPIP
func (op *OmahaPlayer) GetVPIP() intGetVPIP VPIP%取得 (0 if totalHands==0)
### func (*OmahaPlayer) GetVPIPCount
func (op *OmahaPlayer) GetVPIPCount() intGetVPIPCount 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) errorUnmarshalJSON implements json.Unmarshaler.
OmahaResult ショーダウン結果
type OmahaResult = HoldemResultOmahaSidePot サイドポット (共通SidePot型のエイリアス)
type OmahaSidePot = SidePotPigsTail ぶたのしっぽゲームクラス
type PigsTail struct {
// contains filtered or unexported fields
}func NewPigsTail(trumpCards *TrumpCards, players []*PigsTailPlayer) *PigsTailNewPigsTail コンストラクタ
### func (*PigsTail) CpuAction
func (pt *PigsTail) CpuAction() errorCpuAction CPUプレイヤーが1ターン実行
### func (*PigsTail) GetActionLog
func (pt *PigsTail) GetActionLog() []*ActionLogEntryGetActionLog 棋譜を取得する
### func (*PigsTail) GetCenter
func (pt *PigsTail) GetCenter() []*CardGetCenter 中央の場札を取得する
### func (*PigsTail) GetCenterTopCard
func (pt *PigsTail) GetCenterTopCard() *CardGetCenterTopCard 場札の一番上のカードを取得する (空ならnil)
### func (*PigsTail) GetCircleCount
func (pt *PigsTail) GetCircleCount() intGetCircleCount 山札の残り枚数を取得する
### func (*PigsTail) GetConfig
func (pt *PigsTail) GetConfig() PigsTailConfigGetConfig ゲーム設定取得
### func (*PigsTail) GetCpuActions
func (pt *PigsTail) GetCpuActions() []*PigsTailCpuActionGetCpuActions CPUターンの行動履歴を取得する
### func (*PigsTail) GetCurrentTurn
func (pt *PigsTail) GetCurrentTurn() intGetCurrentTurn 現在の手番プレイヤーインデックスを取得する
### func (*PigsTail) GetGameEndFlag
func (pt *PigsTail) GetGameEndFlag() boolGetGameEndFlag ゲーム終了フラグを取得する
### func (*PigsTail) GetHumanAction
func (pt *PigsTail) GetHumanAction() *PigsTailCpuActionGetHumanAction 人間の最後の行動記録を取得する
### func (*PigsTail) GetLastDrawCard
func (pt *PigsTail) GetLastDrawCard() *CardGetLastDrawCard 最後に引いたカードを取得する
### func (*PigsTail) GetLastPenalty
func (pt *PigsTail) GetLastPenalty() boolGetLastPenalty 最後のアクションでペナルティが発生したかを取得する
### func (*PigsTail) GetLoserIdx
func (pt *PigsTail) GetLoserIdx() intGetLoserIdx 負けプレイヤーインデックスを取得する
### func (*PigsTail) GetPlayer
func (pt *PigsTail) GetPlayer(i int) *PigsTailPlayerGetPlayer 指定インデックスのプレイヤーを取得する
### func (*PigsTail) GetPlayerCnt
func (pt *PigsTail) GetPlayerCnt() intGetPlayerCnt プレイヤー数を取得する
### func (*PigsTail) IsHumanTurn
func (pt *PigsTail) IsHumanTurn() boolIsHumanTurn 現在の手番が人間かを返す
### func (*PigsTail) MarshalJSON
func (pt *PigsTail) MarshalJSON() ([]byte, error)MarshalJSON implements json.Marshaler.
### func (*PigsTail) PlayerAction
func (pt *PigsTail) PlayerAction(_ int) errorPlayerAction 人間プレイヤーのアクション (山札から1枚引く)
func (pt *PigsTail) Reset()Reset ゲーム初期化
### func (*PigsTail) SetConfig
func (pt *PigsTail) SetConfig(config PigsTailConfig)SetConfig ゲーム設定をセット
### func (*PigsTail) UnmarshalJSON
func (pt *PigsTail) UnmarshalJSON(data []byte) errorUnmarshalJSON implements json.Unmarshaler.
PigsTailConfig ぶたのしっぽ設定
type PigsTailConfig struct {
CpuHesitationEnabled bool // CPU迷い時間ディレイ
}### func DefaultPigsTailConfig
func DefaultPigsTailConfig() PigsTailConfigDefaultPigsTailConfig デフォルト設定を返す
### func (PigsTailConfig) MarshalJSON
func (c PigsTailConfig) MarshalJSON() ([]byte, error)MarshalJSON implements json.Marshaler.
### func (*PigsTailConfig) UnmarshalJSON
func (c *PigsTailConfig) UnmarshalJSON(data []byte) errorUnmarshalJSON implements json.Unmarshaler.
### func (PigsTailConfig) Validate
func (c PigsTailConfig) Validate() errorValidate 設定値のドメインバリデーション
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) errorUnmarshalJSON implements json.Unmarshaler.
PigsTailPlayer ぶたのしっぽプレイヤークラス
type PigsTailPlayer struct {
*GamePlayer
}func NewPigsTailPlayer(isHuman bool) *PigsTailPlayerNewPigsTailPlayer コンストラクタ
### func (*PigsTailPlayer) MarshalJSON
func (p *PigsTailPlayer) MarshalJSON() ([]byte, error)MarshalJSON implements json.Marshaler.
### func (*PigsTailPlayer) UnmarshalJSON
func (p *PigsTailPlayer) UnmarshalJSON(data []byte) errorUnmarshalJSON implements json.Unmarshaler.
Pineapple パイナップルポーカー (Crazy Pineapple) クラス ホールカード3枚を配り、フロップ後に1枚をディスカードする
type Pineapple struct {
// contains filtered or unexported fields
}func NewPineapple(trumpCards *TrumpCards, players []*PineapplePlayer, config PineappleConfig) *PineappleNewPineapple コンストラクタ
func (p *Pineapple) Addon() errorAddon 人間プレイヤーがアドオンを実行する
### func (*Pineapple) DiscardCard
func (p *Pineapple) DiscardCard(cardIdx int) errorDiscardCard 人間プレイヤーが手札から1枚をディスカードする
### func (*Pineapple) ExportProfile
func (p *Pineapple) ExportProfile() interface{}ExportProfile メタAIプロファイルをエクスポートする
### func (*Pineapple) GetActedFlags
func (p *Pineapple) GetActedFlags() []boolGetActedFlags actedフラグ取得
### func (*Pineapple) GetActionLog
func (p *Pineapple) GetActionLog() []*ActionLogEntryGetActionLog 棋譜を取得する
### func (*Pineapple) GetAddonUsed
func (p *Pineapple) GetAddonUsed() []boolGetAddonUsed プレイヤーごとのアドオン使用フラグ取得
### func (*Pineapple) GetCommunityCards
func (p *Pineapple) GetCommunityCards() []*CardGetCommunityCards コミュニティカード取得
### func (*Pineapple) GetConfig
func (p *Pineapple) GetConfig() PineappleConfigGetConfig 設定取得
### func (*Pineapple) GetCpuActions
func (p *Pineapple) GetCpuActions() []PineappleCpuActionGetCpuActions CPU行動記録取得
### func (*Pineapple) GetCurrentTurn
func (p *Pineapple) GetCurrentTurn() intGetCurrentTurn 現在のターン取得
### func (*Pineapple) GetDealerIdx
func (p *Pineapple) GetDealerIdx() intGetDealerIdx ディーラーインデックス取得
### func (*Pineapple) GetDiscardDone
func (p *Pineapple) GetDiscardDone() []boolGetDiscardDone ディスカード済みフラグ取得
### func (*Pineapple) GetEquity
func (p *Pineapple) GetEquity() *HoldemEquityResultGetEquity エクイティ計算結果を返す
### func (*Pineapple) GetGameEndFlag
func (p *Pineapple) GetGameEndFlag() boolGetGameEndFlag ゲーム終了フラグ取得
### func (*Pineapple) GetHandCount
func (p *Pineapple) GetHandCount() intGetHandCount ハンド数取得
### func (*Pineapple) GetHumanProfile
func (p *Pineapple) GetHumanProfile() *BettingHumanProfileGetHumanProfile メタAIプロファイル取得
### func (*Pineapple) GetLastBet
func (p *Pineapple) GetLastBet() intGetLastBet 最後のベット取得
### func (*Pineapple) GetLastCpuError
func (p *Pineapple) GetLastCpuError() errorGetLastCpuError 最後のCPUアクションエラー取得
### func (*Pineapple) GetMinRaise
func (p *Pineapple) GetMinRaise() intGetMinRaise 最小レイズ額取得
### func (*Pineapple) GetPhase
func (p *Pineapple) GetPhase() intGetPhase フェーズ取得
### func (*Pineapple) GetPlayer
func (p *Pineapple) GetPlayer(i int) *PineapplePlayerGetPlayer 指定プレイヤー取得
### func (*Pineapple) GetPlayerCnt
func (p *Pineapple) GetPlayerCnt() intGetPlayerCnt プレイヤー数取得
### func (*Pineapple) GetPlayers
func (p *Pineapple) GetPlayers() []*PineapplePlayerGetPlayers プレイヤー一覧取得
func (p *Pineapple) GetPot() intGetPot ポット取得
### func (*Pineapple) GetPotOdds
func (p *Pineapple) GetPotOdds() float64GetPotOdds ポットオッズを返す
### func (*Pineapple) GetRaiseCount
func (p *Pineapple) GetRaiseCount() intGetRaiseCount 現在のレイズ回数取得
### func (*Pineapple) GetRebuyCounts
func (p *Pineapple) GetRebuyCounts() []intGetRebuyCounts プレイヤーごとのリバイ回数取得
### func (*Pineapple) GetRebuyPhaseType
func (p *Pineapple) GetRebuyPhaseType() intGetRebuyPhaseType リバイフェーズ種別取得
### func (*Pineapple) GetRoundResults
func (p *Pineapple) GetRoundResults() []PineappleResultGetRoundResults ラウンド結果取得
### func (*Pineapple) GetSidePots
func (p *Pineapple) GetSidePots() []PineappleSidePotGetSidePots サイドポット取得
### func (*Pineapple) ImportProfile
func (p *Pineapple) ImportProfile(data []byte) errorImportProfile JSONバイトからメタAIプロファイルをインポートする
### func (*Pineapple) IsAddonAvailable
func (p *Pineapple) IsAddonAvailable() boolIsAddonAvailable 人間プレイヤーがアドオン可能かどうか
### func (*Pineapple) IsDiscardPhase
func (p *Pineapple) IsDiscardPhase() boolIsDiscardPhase ディスカードフェーズかどうか
### func (*Pineapple) IsHumanTurn
func (p *Pineapple) IsHumanTurn() boolIsHumanTurn 人間のターンかチェック
### func (*Pineapple) IsMuckAvailable
func (p *Pineapple) IsMuckAvailable() boolIsMuckAvailable 人間プレイヤーがマック可能かどうか
### func (*Pineapple) IsRebuyAvailable
func (p *Pineapple) IsRebuyAvailable() boolIsRebuyAvailable 人間プレイヤーがリバイ可能かどうか
### func (*Pineapple) MarshalJSON
func (p *Pineapple) MarshalJSON() ([]byte, error)MarshalJSON implements json.Marshaler.
func (p *Pineapple) Muck() errorMuck 人間プレイヤーがハンドをマックする
### func (*Pineapple) PlayerAction
func (p *Pineapple) PlayerAction(action, amount, humanPlayMs int) errorPlayerAction 人間プレイヤーのアクション実行 humanPlayMs: 迷い時間(ms, 0=計測なし)
func (p *Pineapple) Rebuy() errorRebuy 人間プレイヤーがリバイを実行する
func (p *Pineapple) Reset() errorReset ゲーム初期化
### func (*Pineapple) ResetProfile
func (p *Pineapple) ResetProfile()ResetProfile メタAIプロファイルをリセットする
func (p *Pineapple) Resize(players []*PineapplePlayer)Resize プレイヤースライスを差し替え、プレイヤー数依存スライスを再初期化する
### func (*Pineapple) SetConfig
func (p *Pineapple) SetConfig(cfg PineappleConfig)SetConfig 設定変更
### func (*Pineapple) ShowHand
func (p *Pineapple) ShowHand() errorShowHand 人間プレイヤーがハンドを公開する
### func (*Pineapple) SkipAddon
func (p *Pineapple) SkipAddon() errorSkipAddon 人間プレイヤーがアドオンを辞退する
### func (*Pineapple) SkipRebuy
func (p *Pineapple) SkipRebuy() errorSkipRebuy 人間プレイヤーがリバイを辞退する
### func (*Pineapple) UnmarshalJSON
func (p *Pineapple) UnmarshalJSON(data []byte) errorUnmarshalJSON implements json.Unmarshaler.
PineappleConfig パイナップルポーカー設定 (HoldemConfigと同一構造)
type PineappleConfig = HoldemConfig### func DefaultPineappleConfig
func DefaultPineappleConfig() PineappleConfigDefaultPineappleConfig デフォルト設定
PineappleCpuAction CPU行動記録
type PineappleCpuAction = HoldemCpuActionPineapplePlayStyle CPUプレイスタイル (HoldemPlayStyleと同一)
type PineapplePlayStyle = HoldemPlayStylePineapplePlayer パイナップルポーカープレイヤークラス
type PineapplePlayer struct {
Player // 親クラス
ChipHolder // チップ管理
// contains filtered or unexported fields
}func NewPineapplePlayer(isHuman bool, style HoldemPlayStyle) *PineapplePlayerNewPineapplePlayer コンストラクタ
### func NewPineapplePlayersForTable
func NewPineapplePlayersForTable(tableSize int) []*PineapplePlayerNewPineapplePlayersForTable 指定されたテーブルサイズに応じたパイナップルプレイヤースライスを生成する
### func (*PineapplePlayer) EvalBestHand
func (pp *PineapplePlayer) EvalBestHand(communityCards []*Card) intEvalBestHand コミュニティカードとホールカードからベスト5枚を評価 ディスカード後は2枚のホールカード + コミュニティカードからC(N,5)で評価 (Holdemと同じ) ディスカード前は3枚のホールカード + コミュニティカードからC(N,5)で評価
### func (*PineapplePlayer) GetAFDisplay
func (pp *PineapplePlayer) GetAFDisplay() stringGetAFDisplay AF表示文字列取得 (“-”=アクションなし, “∞”=コールなし, “X.X”=通常)
### func (*PineapplePlayer) GetBestHand
func (pp *PineapplePlayer) GetBestHand() []*CardGetBestHand ベストハンド取得
### func (*PineapplePlayer) GetComparisonCards
func (pp *PineapplePlayer) GetComparisonCards() []*CardGetComparisonCards ハンド比較用カード取得 (BettingPlayerインターフェース)
### func (*PineapplePlayer) GetIsHuman
func (pp *PineapplePlayer) GetIsHuman() boolGetIsHuman 人間フラグ取得
### func (*PineapplePlayer) GetPFR
func (pp *PineapplePlayer) GetPFR() intGetPFR PFR%取得 (0 if totalHands==0)
### func (*PineapplePlayer) GetPFRCount
func (pp *PineapplePlayer) GetPFRCount() intGetPFRCount PFR対象ハンド数取得
### func (*PineapplePlayer) GetPlayStyle
func (pp *PineapplePlayer) GetPlayStyle() HoldemPlayStyleGetPlayStyle プレイスタイル取得
### func (*PineapplePlayer) GetPlayStyleName
func (pp *PineapplePlayer) GetPlayStyleName() stringGetPlayStyleName プレイスタイル名取得
### func (*PineapplePlayer) GetPostFlopBetRaise
func (pp *PineapplePlayer) GetPostFlopBetRaise() intGetPostFlopBetRaise ポストフロップ ベット+レイズ回数取得
### func (*PineapplePlayer) GetPostFlopCall
func (pp *PineapplePlayer) GetPostFlopCall() intGetPostFlopCall ポストフロップ コール回数取得
### func (*PineapplePlayer) GetThreeBet
func (pp *PineapplePlayer) GetThreeBet() intGetThreeBet 3Bet%取得 (0 if threeBetOpportunity==0)
### func (*PineapplePlayer) GetThreeBetCount
func (pp *PineapplePlayer) GetThreeBetCount() intGetThreeBetCount 3Bet実行数取得
### func (*PineapplePlayer) GetThreeBetOpportunity
func (pp *PineapplePlayer) GetThreeBetOpportunity() intGetThreeBetOpportunity 3Bet機会数取得
### func (*PineapplePlayer) GetTotalHands
func (pp *PineapplePlayer) GetTotalHands() intGetTotalHands 総ハンド数取得
### func (*PineapplePlayer) GetVPIP
func (pp *PineapplePlayer) GetVPIP() intGetVPIP VPIP%取得 (0 if totalHands==0)
### func (*PineapplePlayer) GetVPIPCount
func (pp *PineapplePlayer) GetVPIPCount() intGetVPIPCount 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) errorUnmarshalJSON implements json.Unmarshaler.
PineappleResult ショーダウン結果
type PineappleResult = HoldemResultPineappleSidePot サイドポット (共通SidePot型のエイリアス)
type PineappleSidePot = SidePotPinochle ピノクルゲームクラス
type Pinochle struct {
// contains filtered or unexported fields
}func NewPinochle(trumpCards *TrumpCards, players []*PinochlePlayer, config PinochleConfig) *PinochleNewPinochle コンストラクタ
### func (*Pinochle) ConfirmMelds
func (p *Pinochle) ConfirmMelds()ConfirmMelds メルドを確認してプレイフェーズに進む
func (p *Pinochle) CpuBid()CpuBid CPUがビッドまたはパスする
### func (*Pinochle) CpuCallTrump
func (p *Pinochle) CpuCallTrump()CpuCallTrump CPUがトランプを宣言する
func (p *Pinochle) CpuPlay()CpuPlay CPUがカードをプレイする
### func (*Pinochle) GetActionLog
func (p *Pinochle) GetActionLog() []*ActionLogEntryGetActionLog アクションログを取得
### func (*Pinochle) GetBidPlayerIdx
func (p *Pinochle) GetBidPlayerIdx() intGetBidPlayerIdx ビッド手番インデックスを取得
### func (*Pinochle) GetConfig
func (p *Pinochle) GetConfig() PinochleConfigGetConfig 設定を取得
### func (*Pinochle) GetCurrentPlayerIdx
func (p *Pinochle) GetCurrentPlayerIdx() intGetCurrentPlayerIdx 現在のプレイヤーインデックスを取得
### func (*Pinochle) GetCurrentTrick
func (p *Pinochle) GetCurrentTrick() []*PinochleTrickCardGetCurrentTrick 現在のトリックを取得
### func (*Pinochle) GetDealerIdx
func (p *Pinochle) GetDealerIdx() intGetDealerIdx ディーラーインデックスを取得
### func (*Pinochle) GetGameEndFlag
func (p *Pinochle) GetGameEndFlag() boolGetGameEndFlag ゲーム終了フラグを取得
### func (*Pinochle) GetHighestBid
func (p *Pinochle) GetHighestBid() intGetHighestBid 最高ビッド額を取得
### func (*Pinochle) GetHighestBidder
func (p *Pinochle) GetHighestBidder() intGetHighestBidder 最高ビッダーインデックスを取得
func (p *Pinochle) GetHint() *PinochleHintGetHint ヒントを取得する
### func (*Pinochle) GetLeadPlayerIdx
func (p *Pinochle) GetLeadPlayerIdx() intGetLeadPlayerIdx リードプレイヤーインデックスを取得
func (p *Pinochle) GetPhase() PinochlePhaseGetPhase フェーズを取得
### func (*Pinochle) GetPlayer
func (p *Pinochle) GetPlayer(i int) *PinochlePlayerGetPlayer 指定インデックスのプレイヤーを取得する
### func (*Pinochle) GetPlayerCnt
func (p *Pinochle) GetPlayerCnt() intGetPlayerCnt プレイヤー数を取得する
### func (*Pinochle) GetPlayerMelds
func (p *Pinochle) GetPlayerMelds() [PinochlePlayerCnt][]*PinochleMeldGetPlayerMelds プレイヤーのメルドを取得
### func (*Pinochle) GetPlayers
func (p *Pinochle) GetPlayers() []*PinochlePlayerGetPlayers プレイヤーを取得
### func (*Pinochle) GetRoundNumber
func (p *Pinochle) GetRoundNumber() intGetRoundNumber ラウンド番号を取得
### func (*Pinochle) GetTeamScore
func (p *Pinochle) GetTeamScore(team int) intGetTeamScore チームスコアを取得する
### func (*Pinochle) GetTeamScores
func (p *Pinochle) GetTeamScores() [PinochleTeamCnt]intGetTeamScores チームスコアを取得
### func (*Pinochle) GetTrickNumber
func (p *Pinochle) GetTrickNumber() intGetTrickNumber トリック番号を取得
### func (*Pinochle) GetTrumpSuit
func (p *Pinochle) GetTrumpSuit() intGetTrumpSuit 切り札スートを取得
### func (*Pinochle) GetValidPlayIndices
func (p *Pinochle) GetValidPlayIndices(playerIdx int) []intGetValidPlayIndices プレイ可能なカードのインデックスを返す (外部公開用)
### func (*Pinochle) GetWinnerTeam
func (p *Pinochle) GetWinnerTeam() intGetWinnerTeam 勝利チームを取得
func (p *Pinochle) Hint() *PinochleHintHint ヒントを返す
### func (*Pinochle) IsHumanBidTurn
func (p *Pinochle) IsHumanBidTurn() boolIsHumanBidTurn 現在のビッド手番が人間かを返す
### func (*Pinochle) IsHumanTurn
func (p *Pinochle) IsHumanTurn() boolIsHumanTurn 現在の手番が人間かを返す
### 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) errorPlayerBid 人間プレイヤーがビッドする
### func (*Pinochle) PlayerCallTrump
func (p *Pinochle) PlayerCallTrump(suit int) errorPlayerCallTrump 人間プレイヤーがトランプスートを宣言する
### func (*Pinochle) PlayerPass
func (p *Pinochle) PlayerPass() errorPlayerPass 人間プレイヤーがパスする
### func (*Pinochle) PlayerPlay
func (p *Pinochle) PlayerPlay(cardIndex int) errorPlayerPlay 人間プレイヤーがカードをプレイする
func (p *Pinochle) Reset()Reset ゲーム初期化
### func (*Pinochle) ResolveTrick
func (p *Pinochle) ResolveTrick()ResolveTrick トリックを解決する
### func (*Pinochle) SetConfig
func (p *Pinochle) SetConfig(config PinochleConfig)SetConfig 設定を変更
func (p *Pinochle) SortHand(playerIdx int)SortHand 手札をソートする (スート順 → ランク順) ReorderCards を使用してインプレースで並び替えることで Reset+AddCard の副作用を回避する
### func (*Pinochle) UnmarshalJSON
func (p *Pinochle) UnmarshalJSON(data []byte) errorUnmarshalJSON implements json.Unmarshaler.
PinochleConfig ピノクルゲーム設定
type PinochleConfig struct {
CpuDifficulty PinochleCpuDifficulty `json:"cd"`
PointLimit int `json:"pl"` // ゲーム終了スコア (先に到達したチームが勝利, デフォルト1500)
}### func DefaultPinochleConfig
func DefaultPinochleConfig() PinochleConfigDefaultPinochleConfig デフォルト設定を返す
### func (PinochleConfig) Validate
func (c PinochleConfig) Validate() errorValidate 設定値のドメインバリデーション
PinochleCpuDifficulty CPU の難易度レベル
type PinochleCpuDifficulty intconst (
// PinochleCpuDifficultyEasy 低難易度
PinochleCpuDifficultyEasy PinochleCpuDifficulty = iota
// PinochleCpuDifficultyNormal 中難易度
PinochleCpuDifficultyNormal
// PinochleCpuDifficultyHard 高難易度
PinochleCpuDifficultyHard
)PinochleHint ヒント情報
type PinochleHint struct {
CardIndex *int // 推奨カードインデックス (プレイ時)
BidAmount *int // 推奨ビッド額 (ビッド時)
Pass *bool // パスすべきか
Suit *int // 推奨スート (トランプ宣言時)
Reason string // ヒント理由キー
}PinochleMeld 検出されたメルド
type PinochleMeld struct {
Type PinochleMeldType `json:"t"`
Points int `json:"p"`
Cards []*Card `json:"c"`
}PinochleMeldType メルドの種類
type PinochleMeldType intconst (
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)
)PinochlePhase ゲームフェーズ
type PinochlePhase intconst (
// 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
)PinochlePlayer ピノクルプレイヤークラス
type PinochlePlayer struct {
*GamePlayer
TrickHolder
// contains filtered or unexported fields
}func NewPinochlePlayer(isHuman bool, team int) *PinochlePlayerNewPinochlePlayer コンストラクタ
### func (*PinochlePlayer) AddTrickPoints
func (p *PinochlePlayer) AddTrickPoints(pts int)AddTrickPoints トリックポイントを加算
### func (*PinochlePlayer) GetBid
func (p *PinochlePlayer) GetBid() intGetBid ビッド額を取得
### func (*PinochlePlayer) GetHasPassed
func (p *PinochlePlayer) GetHasPassed() boolGetHasPassed パス済みかどうかを取得
### func (*PinochlePlayer) GetMeldScore
func (p *PinochlePlayer) GetMeldScore() intGetMeldScore メルド得点を取得
### func (*PinochlePlayer) GetTeam
func (p *PinochlePlayer) GetTeam() intGetTeam チームインデックスを取得
### func (*PinochlePlayer) GetTrickPoints
func (p *PinochlePlayer) GetTrickPoints() intGetTrickPoints トリックポイントを取得
### 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) errorUnmarshalJSON implements json.Unmarshaler.
PinochleTrickCard トリック中の1枚
type PinochleTrickCard struct {
PlayerIdx int `json:"pi"`
Card *Card `json:"c"`
}Player プレイヤークラス
type Player struct {
// contains filtered or unexported fields
}func (p *Player) AddCard(card *Card)AddCard カード追加
func (p *Player) GetCard(idx int) *CardGetCard 指定番目のカード取得
### func (*Player) GetCardsSize
func (p *Player) GetCardsSize() intGetCardsSize プレイヤーカードの枚数取得
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 (p *Player) RemoveCard(idx int) *CardRemoveCard 指定インデックスのカードを手札から取り除いて返す。 範囲外なら nil を返す。
### func (*Player) RemoveCards
func (p *Player) RemoveCards(indices []int) []*CardRemoveCards 複数インデックスのカードを手札から取り除いて返す。 重複インデックスは自動排除、範囲外は無視。返却順はインデックス昇順。
### func (*Player) ReorderCards
func (p *Player) ReorderCards(indices []int) errorReorderCards indices で指定された順番に手札を並び替える。 indices は [0, len(cards)) の有効な順列でなければならない。
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) errorUnmarshalJSON implements json.Unmarshaler.
Poker ポーカークラス (5枚ドローポーカー・マルチプレイヤー)
type Poker struct {
// contains filtered or unexported fields
}func NewPoker(trumpCards *TrumpCards, players []*PokerPlayer, config PokerConfig) *PokerNewPoker コンストラクタ
### 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() []*ActionLogEntryGetActionLog 棋譜を取得する
func (p *Poker) GetAnte() intGetAnte アンティ取得
func (p *Poker) GetConfig() PokerConfigGetConfig 設定取得
### func (*Poker) GetCpuActions
func (p *Poker) GetCpuActions() []PokerCpuActionGetCpuActions CPU行動記録取得
### func (*Poker) GetCpuExchanges
func (p *Poker) GetCpuExchanges() []PokerCpuExchangeGetCpuExchanges CPU交換記録取得
### func (*Poker) GetCurrentTurn
func (p *Poker) GetCurrentTurn() intGetCurrentTurn 現在のターン取得
### func (*Poker) GetDealerIdx
func (p *Poker) GetDealerIdx() intGetDealerIdx ディーラーインデックス取得
### func (*Poker) GetGameEndFlag
func (p *Poker) GetGameEndFlag() boolGetGameEndFlag ゲーム終了フラグ取得
### func (*Poker) GetHumanProfile
func (p *Poker) GetHumanProfile() *BettingHumanProfileGetHumanProfile メタAIプロファイル取得
func (p *Poker) GetLastBet() intGetLastBet 最後のベット取得
### func (*Poker) GetLastCpuError
func (p *Poker) GetLastCpuError() errorGetLastCpuError 最後のCPUアクションエラー取得 (テスト・デバッグ用)
func (p *Poker) GetMinRaise() intGetMinRaise 最小レイズ額取得
func (p *Poker) GetPhase() intGetPhase フェーズ取得
func (p *Poker) GetPlayers() []*PokerPlayerGetPlayers プレイヤー一覧取得
func (p *Poker) GetPot() intGetPot ポット取得
### func (*Poker) GetRaiseCount
func (p *Poker) GetRaiseCount() intGetRaiseCount 現在のレイズ回数取得
### func (*Poker) GetRoundResults
func (p *Poker) GetRoundResults() []PokerResultGetRoundResults ラウンド結果取得
func (p *Poker) GetSidePots() []PokerSidePotGetSidePots サイドポット取得
### func (*Poker) ImportProfile
func (p *Poker) ImportProfile(data []byte) errorImportProfile JSONバイトからメタAIプロファイルをインポートする
func (p *Poker) MarshalJSON() ([]byte, error)MarshalJSON implements json.Marshaler.
### func (*Poker) PlayerAction
func (p *Poker) PlayerAction(action, amount, humanPlayMs int) errorPlayerAction 人間プレイヤーのアクション実行 humanPlayMs: 迷い時間(ms, 0=計測なし)
### func (*Poker) PlayerExchange
func (p *Poker) PlayerExchange(indices []int) errorPlayerExchange プレイヤーカード交換
func (p *Poker) PlayerStand() errorPlayerStand カード交換なし
func (p *Poker) Reset() errorReset ゲーム初期化
### func (*Poker) ResetProfile
func (p *Poker) ResetProfile()ResetProfile メタAIプロファイルをリセットする
func (p *Poker) SetConfig(cfg PokerConfig)SetConfig 設定変更
### func (*Poker) UnmarshalJSON
func (p *Poker) UnmarshalJSON(data []byte) errorUnmarshalJSON implements json.Unmarshaler.
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() PokerConfigDefaultPokerConfig デフォルト設定
### func (PokerConfig) Validate
func (c PokerConfig) Validate() errorValidate 設定値のドメインバリデーション
PokerCpuAction CPU行動記録
type PokerCpuAction struct {
PlayerIdx int // プレイヤーインデックス
Action int // アクション
Amount int // 金額
}PokerCpuExchange CPUカード交換記録
type PokerCpuExchange struct {
PlayerIdx int // プレイヤーインデックス
ExchangeCount int // 交換枚数
}PokerDrawOdds ドローオッズ (各ハンドランクの確率)
type PokerDrawOdds struct {
HandRank int // ハンドランク
HandName string // ハンド名
Probability float64 // 確率 (0.0 - 1.0)
Count int // 該当する組み合わせ数
Total int // 全組み合わせ数
}PokerPlayStyle CPUプレイスタイル
type PokerPlayStyle intconst (
PokerStyleConservative PokerPlayStyle = iota // 保守的
PokerStyleBalanced // バランス
PokerStyleAggressive // 攻撃的
PokerStyleBluffer // ブラフ重視
)PokerPlayer ポーカープレイヤークラス
type PokerPlayer struct {
Player // 親クラス
ChipHolder // チップ管理
// contains filtered or unexported fields
}func NewPokerPlayer(isHuman bool, style PokerPlayStyle) *PokerPlayerNewPokerPlayer コンストラクタ
### func (*PokerPlayer) EvalHand
func (pp *PokerPlayer) EvalHand() intEvalHand ハンド評価
### func (*PokerPlayer) ExchangeCard
func (pp *PokerPlayer) ExchangeCard(idx int, card *Card)ExchangeCard 指定インデックスのカードを交換
### func (*PokerPlayer) GetComparisonCards
func (pp *PokerPlayer) GetComparisonCards() []*CardGetComparisonCards ハンド比較用カード取得 (BettingPlayerインターフェース)
### func (*PokerPlayer) GetExchangeCount
func (pp *PokerPlayer) GetExchangeCount() intGetExchangeCount 交換枚数取得
### func (*PokerPlayer) GetHandName
func (pp *PokerPlayer) GetHandName() stringGetHandName ハンド名取得
### func (*PokerPlayer) GetIsHuman
func (pp *PokerPlayer) GetIsHuman() boolGetIsHuman 人間フラグ取得
### func (*PokerPlayer) GetPlayStyle
func (pp *PokerPlayer) GetPlayStyle() PokerPlayStyleGetPlayStyle プレイスタイル取得
### func (*PokerPlayer) GetPlayStyleName
func (pp *PokerPlayer) GetPlayStyleName() stringGetPlayStyleName プレイスタイル名取得
### 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) errorUnmarshalJSON implements json.Unmarshaler.
PokerResult ショーダウン結果
type PokerResult struct {
PlayerIdx int // プレイヤーインデックス
HandRank int // ハンドランク
HandName string // ハンド名
Kickers []int // キッカーカード値
WonAmount int // 獲得チップ
}PokerSidePot サイドポット (共通SidePot型のエイリアス)
type PokerSidePot = SidePotPyramid ピラミッドソリティアゲームクラス
type Pyramid struct {
// contains filtered or unexported fields
}func NewPyramid(trumpCards *TrumpCards) *PyramidNewPyramid コンストラクタ
### func (*Pyramid) AllRemoved
func (p *Pyramid) AllRemoved() boolAllRemoved 全ピラミッドカードが除去されたか
func (p *Pyramid) CanUndo() boolCanUndo アンドゥ可能かどうか
func (p *Pyramid) Draw() errorDraw ストックからウェイストにカードを引く
### func (*Pyramid) GetActionLog
func (p *Pyramid) GetActionLog() []*ActionLogEntryGetActionLog 棋譜取得
func (p *Pyramid) GetHint() *PyramidHintGetHint ヒントを取得
### func (*Pyramid) GetMoveCount
func (p *Pyramid) GetMoveCount() intGetMoveCount 移動回数取得
func (p *Pyramid) GetPhase() PyramidPhaseGetPhase フェーズ取得
### func (*Pyramid) GetPyramid
func (p *Pyramid) GetPyramid() [PyramidRowCnt][]*PyramidCardGetPyramid ピラミッド取得
### func (*Pyramid) GetStockCount
func (p *Pyramid) GetStockCount() intGetStockCount ストック枚数取得
func (p *Pyramid) GetWaste() []*CardGetWaste ウェイスト取得
func (p *Pyramid) GiveUp()GiveUp ギブアップ
func (p *Pyramid) IsExposed(row, col int) boolIsExposed カードが露出しているか (テスト用の公開版)
### func (*Pyramid) IsStalemate
func (p *Pyramid) IsStalemate() boolIsStalemate 手詰まり状態取得
### func (*Pyramid) MarshalJSON
func (p *Pyramid) MarshalJSON() ([]byte, error)MarshalJSON implements json.Marshaler.
### func (*Pyramid) RemoveKing
func (p *Pyramid) RemoveKing(row, col int) errorRemoveKing ピラミッド上のKを単独で除去
### func (*Pyramid) RemovePair
func (p *Pyramid) RemovePair(row1, col1, row2, col2 int) errorRemovePair ピラミッド上の2枚のカードを合計13で除去
### func (*Pyramid) RemoveWasteKing
func (p *Pyramid) RemoveWasteKing() errorRemoveWasteKing ウェイストのトップのKを単独で除去
### func (*Pyramid) RemoveWithWaste
func (p *Pyramid) RemoveWithWaste(row, col int) errorRemoveWithWaste ウェイストのトップカードとピラミッドのカードをペアで除去
func (p *Pyramid) Reset()Reset ゲームリセット
### func (*Pyramid) SetIsStalemate
func (p *Pyramid) SetIsStalemate(v bool)SetIsStalemate 手詰まり状態設定 (テスト用)
func (p *Pyramid) SetPhase(phase PyramidPhase)SetPhase フェーズ設定 (テスト用)
### func (*Pyramid) SetPyramid
func (p *Pyramid) SetPyramid(pyramid [PyramidRowCnt][]*PyramidCard)SetPyramid ピラミッド設定 (テスト用)
func (p *Pyramid) SetStock(stock []*Card)SetStock ストック設定 (テスト用)
func (p *Pyramid) SetWaste(waste []*Card)SetWaste ウェイスト設定 (テスト用)
func (p *Pyramid) Undo() errorUndo 直前の操作を取り消す
func (p *Pyramid) UndoN(n int) errorUndoN n回連続でアンドゥを実行する。
### func (*Pyramid) UndoToEscape
func (p *Pyramid) UndoToEscape() intUndoToEscape 膠着状態から抜けるために必要なアンドゥ回数を返す。膠着状態でなければ0、脱出不可なら-1。
### func (*Pyramid) UnmarshalJSON
func (p *Pyramid) UnmarshalJSON(data []byte) errorUnmarshalJSON implements json.Unmarshaler.
PyramidCard ピラミッド上のカード
type PyramidCard struct {
Card *Card `json:"c"`
Removed bool `json:"r"`
}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
}PyramidPhase ピラミッドゲームフェーズ
type PyramidPhase intconst (
// PyramidPhasePlaying プレイ中
PyramidPhasePlaying PyramidPhase = iota
// PyramidPhaseGameClear ゲームクリア
PyramidPhaseGameClear
// PyramidPhaseGameOver ゲームオーバー
PyramidPhaseGameOver
)RankedGamePlayer ランク付きプレイヤー共通構造体
type RankedGamePlayer struct {
*GamePlayer
// contains filtered or unexported fields
}func NewRankedGamePlayer(isHuman bool) *RankedGamePlayerNewRankedGamePlayer コンストラクタ (rank defaults to -1)
### func (*RankedGamePlayer) GetRank
func (rp *RankedGamePlayer) GetRank() intGetRank ランク取得 (-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) errorUnmarshalJSON implements json.Unmarshaler.
RoundScoreHolder ラウンドスコア管理の共通構造体
type RoundScoreHolder struct {
// contains filtered or unexported fields
}### func (*RoundScoreHolder) CommitRoundScore
func (h *RoundScoreHolder) CommitRoundScore()CommitRoundScore ラウンドスコアを累積スコアに加算
### func (*RoundScoreHolder) GetCumulativeScore
func (h *RoundScoreHolder) GetCumulativeScore() intGetCumulativeScore 累積スコアを取得
### func (*RoundScoreHolder) GetRoundScore
func (h *RoundScoreHolder) GetRoundScore() intGetRoundScore 現在のラウンドスコアを取得
### 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) errorUnmarshalJSON implements json.Unmarshaler.
SevenCardStud セブンカードスタッド
type SevenCardStud struct {
// contains filtered or unexported fields
}func NewSevenCardStud(trumpCards *TrumpCards, players []*SevenCardStudPlayer, config SevenCardStudConfig) *SevenCardStudNewSevenCardStud コンストラクタ
### func (*SevenCardStud) Addon
func (s *SevenCardStud) Addon() errorAddon 人間プレイヤーがアドオンを実行する
### func (*SevenCardStud) ExportProfile
func (s *SevenCardStud) ExportProfile() interface{}ExportProfile メタAIプロファイルをエクスポートする
### func (*SevenCardStud) GetActedFlags
func (s *SevenCardStud) GetActedFlags() []boolGetActedFlags actedフラグ取得
### func (*SevenCardStud) GetActionLog
func (s *SevenCardStud) GetActionLog() []*ActionLogEntryGetActionLog 棋譜を取得する
### func (*SevenCardStud) GetAddonUsed
func (s *SevenCardStud) GetAddonUsed() []boolGetAddonUsed プレイヤーごとのアドオン使用フラグ取得
### func (*SevenCardStud) GetBringInPlayerIdx
func (s *SevenCardStud) GetBringInPlayerIdx() intGetBringInPlayerIdx ブリングインプレイヤーインデックス取得
### func (*SevenCardStud) GetCommunityCard
func (s *SevenCardStud) GetCommunityCard() *CardGetCommunityCard 共有カード取得 (カード不足時のみ)
### func (*SevenCardStud) GetConfig
func (s *SevenCardStud) GetConfig() SevenCardStudConfigGetConfig 設定取得
### func (*SevenCardStud) GetCpuActions
func (s *SevenCardStud) GetCpuActions() []SevenCardStudCpuActionGetCpuActions CPU行動記録取得
### func (*SevenCardStud) GetCurrentTurn
func (s *SevenCardStud) GetCurrentTurn() intGetCurrentTurn 現在のターン取得
### func (*SevenCardStud) GetDealerIdx
func (s *SevenCardStud) GetDealerIdx() intGetDealerIdx ディーラーインデックス取得
### func (*SevenCardStud) GetGameEndFlag
func (s *SevenCardStud) GetGameEndFlag() boolGetGameEndFlag ゲーム終了フラグ取得
### func (*SevenCardStud) GetHandCount
func (s *SevenCardStud) GetHandCount() intGetHandCount ハンド数取得
### func (*SevenCardStud) GetHumanProfile
func (s *SevenCardStud) GetHumanProfile() *BettingHumanProfileGetHumanProfile メタAIプロファイル取得
### func (*SevenCardStud) GetLastBet
func (s *SevenCardStud) GetLastBet() intGetLastBet 最後のベット取得
### func (*SevenCardStud) GetLastCpuError
func (s *SevenCardStud) GetLastCpuError() errorGetLastCpuError 最後のCPUアクションエラー取得
### func (*SevenCardStud) GetMinRaise
func (s *SevenCardStud) GetMinRaise() intGetMinRaise 最小レイズ額取得
### func (*SevenCardStud) GetPhase
func (s *SevenCardStud) GetPhase() intGetPhase フェーズ取得
### func (*SevenCardStud) GetPlayer
func (s *SevenCardStud) GetPlayer(i int) *SevenCardStudPlayerGetPlayer 指定プレイヤー取得
### func (*SevenCardStud) GetPlayerCnt
func (s *SevenCardStud) GetPlayerCnt() intGetPlayerCnt プレイヤー数取得
### func (*SevenCardStud) GetPlayers
func (s *SevenCardStud) GetPlayers() []*SevenCardStudPlayerGetPlayers プレイヤー一覧取得
### func (*SevenCardStud) GetPot
func (s *SevenCardStud) GetPot() intGetPot ポット取得
### func (*SevenCardStud) GetRaiseCount
func (s *SevenCardStud) GetRaiseCount() intGetRaiseCount 現在のレイズ回数取得
### func (*SevenCardStud) GetRebuyCounts
func (s *SevenCardStud) GetRebuyCounts() []intGetRebuyCounts プレイヤーごとのリバイ回数取得
### func (*SevenCardStud) GetRebuyPhaseType
func (s *SevenCardStud) GetRebuyPhaseType() intGetRebuyPhaseType リバイフェーズ種別取得
### func (*SevenCardStud) GetRoundResults
func (s *SevenCardStud) GetRoundResults() []SevenCardStudResultGetRoundResults ラウンド結果取得
### func (*SevenCardStud) GetSidePots
func (s *SevenCardStud) GetSidePots() []SevenCardStudSidePotGetSidePots サイドポット取得
### func (*SevenCardStud) ImportProfile
func (s *SevenCardStud) ImportProfile(data []byte) errorImportProfile JSONバイトからメタAIプロファイルをインポートする
### func (*SevenCardStud) IsAddonAvailable
func (s *SevenCardStud) IsAddonAvailable() boolIsAddonAvailable 人間プレイヤーがアドオン可能かどうか
### func (*SevenCardStud) IsHumanTurn
func (s *SevenCardStud) IsHumanTurn() boolIsHumanTurn 人間のターンかチェック
### func (*SevenCardStud) IsMuckAvailable
func (s *SevenCardStud) IsMuckAvailable() boolIsMuckAvailable 人間プレイヤーがマック可能かどうか
### func (*SevenCardStud) IsRebuyAvailable
func (s *SevenCardStud) IsRebuyAvailable() boolIsRebuyAvailable 人間プレイヤーがリバイ可能かどうか
### func (*SevenCardStud) MarshalJSON
func (s *SevenCardStud) MarshalJSON() ([]byte, error)MarshalJSON implements json.Marshaler.
### func (*SevenCardStud) Muck
func (s *SevenCardStud) Muck() errorMuck 人間プレイヤーがハンドをマックする
### func (*SevenCardStud) PlayerAction
func (s *SevenCardStud) PlayerAction(action, amount, humanPlayMs int) errorPlayerAction 人間プレイヤーのアクション実行
### func (*SevenCardStud) Rebuy
func (s *SevenCardStud) Rebuy() errorRebuy 人間プレイヤーがリバイを実行する
### func (*SevenCardStud) Reset
func (s *SevenCardStud) Reset() errorReset ゲーム初期化
### 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() errorShowHand 人間プレイヤーがハンドを公開する
### func (*SevenCardStud) SkipAddon
func (s *SevenCardStud) SkipAddon() errorSkipAddon 人間プレイヤーがアドオンを辞退する
### func (*SevenCardStud) SkipRebuy
func (s *SevenCardStud) SkipRebuy() errorSkipRebuy 人間プレイヤーがリバイを辞退する
### func (*SevenCardStud) UnmarshalJSON
func (s *SevenCardStud) UnmarshalJSON(data []byte) errorUnmarshalJSON implements json.Unmarshaler.
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() SevenCardStudConfigDefaultSevenCardStudConfig デフォルト設定
### func (SevenCardStudConfig) Validate
func (c SevenCardStudConfig) Validate() errorValidate 設定値のドメインバリデーション
## 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) []SevenCardStudPlayStyleDefaultSevenCardStudCpuStyles テーブルサイズに応じたCPUスタイルを返す
SevenCardStudPlayer セブンカードスタッドプレイヤー
type SevenCardStudPlayer struct {
Player // 親クラス (cardsフィールドは使用しない)
ChipHolder // チップ管理
// contains filtered or unexported fields
}### func NewSevenCardStudPlayer
func NewSevenCardStudPlayer(isHuman bool, style SevenCardStudPlayStyle) *SevenCardStudPlayerNewSevenCardStudPlayer コンストラクタ
### func NewSevenCardStudPlayersForTable
func NewSevenCardStudPlayersForTable(tableSize int) []*SevenCardStudPlayerNewSevenCardStudPlayersForTable 指定されたテーブルサイズに応じたプレイヤースライスを生成する
### 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() intEvalBestHand 全7枚からベスト5枚を評価
### func (*SevenCardStudPlayer) EvalVisibleHand
func (p *SevenCardStudPlayer) EvalVisibleHand() intEvalVisibleHand 表向き札のみからハンドを評価 (ベッティング順序決定用) 5枚未満の場合はハイカード比較用にソートした値を返す
### func (*SevenCardStudPlayer) GetAFDisplay
func (p *SevenCardStudPlayer) GetAFDisplay() stringGetAFDisplay AF表示文字列取得 (“-”=アクションなし, “∞”=コールなし, “X.X”=通常)
### func (*SevenCardStudPlayer) GetAllCards
func (p *SevenCardStudPlayer) GetAllCards() []*CardGetAllCards 全カード取得 (伏せ札+表向き札)
### func (*SevenCardStudPlayer) GetBestHand
func (p *SevenCardStudPlayer) GetBestHand() []*CardGetBestHand ベストハンド取得
### func (*SevenCardStudPlayer) GetComparisonCards
func (p *SevenCardStudPlayer) GetComparisonCards() []*CardGetComparisonCards ハンド比較用カード取得 (BettingPlayerインターフェース)
### func (*SevenCardStudPlayer) GetDoorCards
func (p *SevenCardStudPlayer) GetDoorCards() []*CardGetDoorCards 表向き札取得
### func (*SevenCardStudPlayer) GetHoleCards
func (p *SevenCardStudPlayer) GetHoleCards() []*CardGetHoleCards 伏せ札取得
### func (*SevenCardStudPlayer) GetIsHuman
func (p *SevenCardStudPlayer) GetIsHuman() boolGetIsHuman 人間フラグ取得
### func (*SevenCardStudPlayer) GetPFR
func (p *SevenCardStudPlayer) GetPFR() intGetPFR PFR%取得 (0 if totalHands==0)
### func (*SevenCardStudPlayer) GetPFRCount
func (p *SevenCardStudPlayer) GetPFRCount() intGetPFRCount PFR対象ハンド数取得
### func (*SevenCardStudPlayer) GetPlayStyle
func (p *SevenCardStudPlayer) GetPlayStyle() SevenCardStudPlayStyleGetPlayStyle プレイスタイル取得
### func (*SevenCardStudPlayer) GetPlayStyleName
func (p *SevenCardStudPlayer) GetPlayStyleName() stringGetPlayStyleName プレイスタイル名取得
### func (*SevenCardStudPlayer) GetPostFlopBetRaise
func (p *SevenCardStudPlayer) GetPostFlopBetRaise() intGetPostFlopBetRaise ポストフロップ ベット+レイズ回数取得
### func (*SevenCardStudPlayer) GetPostFlopCall
func (p *SevenCardStudPlayer) GetPostFlopCall() intGetPostFlopCall ポストフロップ コール回数取得
### func (*SevenCardStudPlayer) GetThreeBet
func (p *SevenCardStudPlayer) GetThreeBet() intGetThreeBet 3Bet%取得 (0 if threeBetOpportunity==0)
### func (*SevenCardStudPlayer) GetThreeBetCount
func (p *SevenCardStudPlayer) GetThreeBetCount() intGetThreeBetCount 3Bet実行数取得
### func (*SevenCardStudPlayer) GetThreeBetOpportunity
func (p *SevenCardStudPlayer) GetThreeBetOpportunity() intGetThreeBetOpportunity 3Bet機会数取得
### func (*SevenCardStudPlayer) GetTotalHands
func (p *SevenCardStudPlayer) GetTotalHands() intGetTotalHands 総ハンド数取得
### func (*SevenCardStudPlayer) GetVPIP
func (p *SevenCardStudPlayer) GetVPIP() intGetVPIP VPIP%取得 (0 if totalHands==0)
### func (*SevenCardStudPlayer) GetVPIPCount
func (p *SevenCardStudPlayer) GetVPIPCount() intGetVPIPCount 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) errorUnmarshalJSON implements json.Unmarshaler.
SevenCardStudResult ショーダウン結果
type SevenCardStudResult struct {
PlayerIdx int // プレイヤーインデックス
HandRank int // ハンドランク
HandName string // ハンド名
BestHand []*Card // ベスト5枚
Kickers []int // キッカーカード値
WonAmount int // 獲得チップ
Mucked bool // マックしたかどうか
}SevenCardStudSidePot サイドポット (共通SidePot型のエイリアス)
type SevenCardStudSidePot = SidePotSevens 7並べゲームクラス ボードは各スートごとにビットマスクで管理する (bit i = 値iが配置済み)
type Sevens struct {
// contains filtered or unexported fields
}func NewSevens(trumpCards *TrumpCards, players []*SevensPlayer, config SevensConfig) *SevensNewSevens コンストラクタ
### func (*Sevens) AutoHandleNoOption
func (s *Sevens) AutoHandleNoOption()AutoHandleNoOption 現在のプレイヤーに選択肢がない場合の自動処理 (出せるカードもパスも不可 → 失格)
func (s *Sevens) CpuPlay()CpuPlay 現在の手番がCPUの場合に1ターン実行
### func (*Sevens) GetActionLog
func (s *Sevens) GetActionLog() []*ActionLogEntryGetActionLog 棋譜を取得する
func (s *Sevens) GetConfig() SevensConfigGetConfig ゲーム設定取得
### func (*Sevens) GetCpuActions
func (s *Sevens) GetCpuActions() []*SevensCpuActionGetCpuActions CPUターンの行動履歴取得
### func (*Sevens) GetCurrentTurn
func (s *Sevens) GetCurrentTurn() intGetCurrentTurn 現在の手番プレイヤーインデックス取得
### func (*Sevens) GetGameEndFlag
func (s *Sevens) GetGameEndFlag() boolGetGameEndFlag ゲーム終了フラグ取得
### func (*Sevens) GetHumanAction
func (s *Sevens) GetHumanAction() *SevensCpuActionGetHumanAction 人間の最後の行動取得
func (s *Sevens) GetPlayer(idx int) *SevensPlayerGetPlayer プレイヤー取得
### func (*Sevens) GetPlayerCnt
func (s *Sevens) GetPlayerCnt() intGetPlayerCnt プレイヤー数取得
### func (*Sevens) GetTableMaxVals
func (s *Sevens) GetTableMaxVals() [5]intGetTableMaxVals ボードの各スートの最大値取得 (ビットマスクから算出)
### func (*Sevens) GetTableMinVals
func (s *Sevens) GetTableMinVals() [5]intGetTableMinVals ボードの各スートの最小値取得 (ビットマスクから算出)
### func (*Sevens) GetTablePlaced
func (s *Sevens) GetTablePlaced() [5]uint16GetTablePlaced ボードのビットマスク取得
### func (*Sevens) HasAnyOption
func (s *Sevens) HasAnyOption(playerIdx int) boolHasAnyOption 指定プレイヤーが何らかの行動 (出す/パス) を取れるか
### func (*Sevens) IsHumanTurn
func (s *Sevens) IsHumanTurn() boolIsHumanTurn 現在の手番が人間かどうか
func (s *Sevens) IsPlayable(card *Card) boolIsPlayable カードが現在のボード状態に出せるか判定
### func (*Sevens) MarshalJSON
func (s *Sevens) MarshalJSON() ([]byte, error)MarshalJSON implements json.Marshaler.
func (s *Sevens) PlayerPlay(idx int) errorPlayerPlay 人間プレイヤーがカードを出す (または パスする) idx: 出すカードのインデックス。-1 の場合はパス。
### func (*Sevens) PlayerPlayJoker
func (s *Sevens) PlayerPlayJoker(cardIdx, targetSuit, targetValue int) errorPlayerPlayJoker 人間プレイヤーがジョーカーを指定ポジションに出す cardIdx: ジョーカーの手札インデックス targetSuit: 配置先スート, targetValue: 配置先値
func (s *Sevens) Reset()Reset ゲーム初期化
func (s *Sevens) SetConfig(config SevensConfig)SetConfig 設定変更
### func (*Sevens) UnmarshalJSON
func (s *Sevens) UnmarshalJSON(data []byte) errorUnmarshalJSON implements json.Unmarshaler.
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() SevensConfigDefaultSevensConfig デフォルト設定 (全機能無効)
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 = 出せるカードがなくパスした
}SevensPlayer 7並べプレイヤークラス
type SevensPlayer struct {
*RankedGamePlayer
// contains filtered or unexported fields
}func NewSevensPlayer(isHuman bool) *SevensPlayerNewSevensPlayer コンストラクタ
### func (*SevensPlayer) CanPass
func (p *SevensPlayer) CanPass() boolCanPass パス可能かどうか (maxPasses == 0 は無制限, それ以外は使用済みパス < 最大パス)
### func (*SevensPlayer) GetIsEliminated
func (p *SevensPlayer) GetIsEliminated() boolGetIsEliminated 失格かどうか
### func (*SevensPlayer) GetLastPlayedJoker
func (p *SevensPlayer) GetLastPlayedJoker() boolGetLastPlayedJoker 前回ジョーカーを出したか取得
### func (*SevensPlayer) GetMaxPasses
func (p *SevensPlayer) GetMaxPasses() intGetMaxPasses 最大パス回数取得
### func (*SevensPlayer) GetPassesUsed
func (p *SevensPlayer) GetPassesUsed() intGetPassesUsed 使用済みパス回数取得
### 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() []*CardRemoveSevens 手札からすべての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) errorUnmarshalJSON implements json.Unmarshaler.
ShortDeck ショートデックホールデムクラス
type ShortDeck struct {
// contains filtered or unexported fields
}func NewShortDeck(trumpCards *TrumpCards, players []*ShortDeckPlayer, config ShortDeckConfig) *ShortDeckNewShortDeck コンストラクタ
func (sd *ShortDeck) Addon() errorAddon 人間プレイヤーがアドオンを実行する
### func (*ShortDeck) ExportProfile
func (sd *ShortDeck) ExportProfile() interface{}ExportProfile メタAIプロファイルをエクスポートする (プロファイルがない場合はnil)
### func (*ShortDeck) GetActedFlags
func (sd *ShortDeck) GetActedFlags() []boolGetActedFlags actedフラグ取得
### func (*ShortDeck) GetActionLog
func (sd *ShortDeck) GetActionLog() []*ActionLogEntryGetActionLog 棋譜を取得する
### func (*ShortDeck) GetAddonUsed
func (sd *ShortDeck) GetAddonUsed() []boolGetAddonUsed プレイヤーごとのアドオン使用フラグ取得
### func (*ShortDeck) GetCommunityCards
func (sd *ShortDeck) GetCommunityCards() []*CardGetCommunityCards コミュニティカード取得
### func (*ShortDeck) GetConfig
func (sd *ShortDeck) GetConfig() ShortDeckConfigGetConfig 設定取得
### func (*ShortDeck) GetCpuActions
func (sd *ShortDeck) GetCpuActions() []ShortDeckCpuActionGetCpuActions CPU行動記録取得
### func (*ShortDeck) GetCurrentTurn
func (sd *ShortDeck) GetCurrentTurn() intGetCurrentTurn 現在のターン取得
### func (*ShortDeck) GetDealerIdx
func (sd *ShortDeck) GetDealerIdx() intGetDealerIdx ディーラーインデックス取得
### func (*ShortDeck) GetEquity
func (sd *ShortDeck) GetEquity() *HoldemEquityResultGetEquity エクイティ計算結果を返す
### func (*ShortDeck) GetGameEndFlag
func (sd *ShortDeck) GetGameEndFlag() boolGetGameEndFlag ゲーム終了フラグ取得
### func (*ShortDeck) GetHandCount
func (sd *ShortDeck) GetHandCount() intGetHandCount ハンド数取得
### func (*ShortDeck) GetHumanProfile
func (sd *ShortDeck) GetHumanProfile() *BettingHumanProfileGetHumanProfile メタAIプロファイル取得
### func (*ShortDeck) GetLastBet
func (sd *ShortDeck) GetLastBet() intGetLastBet 最後のベット取得
### func (*ShortDeck) GetLastCpuError
func (sd *ShortDeck) GetLastCpuError() errorGetLastCpuError 最後のCPUアクションエラー取得
### func (*ShortDeck) GetMinRaise
func (sd *ShortDeck) GetMinRaise() intGetMinRaise 最小レイズ額取得
### func (*ShortDeck) GetPhase
func (sd *ShortDeck) GetPhase() intGetPhase フェーズ取得
### func (*ShortDeck) GetPlayer
func (sd *ShortDeck) GetPlayer(i int) *ShortDeckPlayerGetPlayer 指定プレイヤー取得
### func (*ShortDeck) GetPlayerCnt
func (sd *ShortDeck) GetPlayerCnt() intGetPlayerCnt プレイヤー数取得
### func (*ShortDeck) GetPlayers
func (sd *ShortDeck) GetPlayers() []*ShortDeckPlayerGetPlayers プレイヤー一覧取得
func (sd *ShortDeck) GetPot() intGetPot ポット取得
### func (*ShortDeck) GetPotOdds
func (sd *ShortDeck) GetPotOdds() float64GetPotOdds ポットオッズを返す
### func (*ShortDeck) GetRaiseCount
func (sd *ShortDeck) GetRaiseCount() intGetRaiseCount 現在のレイズ回数取得
### func (*ShortDeck) GetRebuyCounts
func (sd *ShortDeck) GetRebuyCounts() []intGetRebuyCounts プレイヤーごとのリバイ回数取得
### func (*ShortDeck) GetRebuyPhaseType
func (sd *ShortDeck) GetRebuyPhaseType() intGetRebuyPhaseType リバイフェーズ種別取得
### func (*ShortDeck) GetRoundResults
func (sd *ShortDeck) GetRoundResults() []ShortDeckResultGetRoundResults ラウンド結果取得
### func (*ShortDeck) GetSidePots
func (sd *ShortDeck) GetSidePots() []ShortDeckSidePotGetSidePots サイドポット取得
### func (*ShortDeck) ImportProfile
func (sd *ShortDeck) ImportProfile(data []byte) errorImportProfile JSONバイトからメタAIプロファイルをインポートする
### func (*ShortDeck) IsAddonAvailable
func (sd *ShortDeck) IsAddonAvailable() boolIsAddonAvailable 人間プレイヤーがアドオン可能かどうか
### func (*ShortDeck) IsHumanTurn
func (sd *ShortDeck) IsHumanTurn() boolIsHumanTurn 人間のターンかチェック
### func (*ShortDeck) IsMuckAvailable
func (sd *ShortDeck) IsMuckAvailable() boolIsMuckAvailable 人間プレイヤーがマック可能かどうか
### func (*ShortDeck) IsRebuyAvailable
func (sd *ShortDeck) IsRebuyAvailable() boolIsRebuyAvailable 人間プレイヤーがリバイ可能かどうか
### func (*ShortDeck) MarshalJSON
func (sd *ShortDeck) MarshalJSON() ([]byte, error)MarshalJSON implements json.Marshaler.
func (sd *ShortDeck) Muck() errorMuck 人間プレイヤーがハンドをマックする
### func (*ShortDeck) PlayerAction
func (sd *ShortDeck) PlayerAction(action, amount, humanPlayMs int) errorPlayerAction 人間プレイヤーのアクション実行 humanPlayMs: 迷い時間(ms, 0=計測なし)
func (sd *ShortDeck) Rebuy() errorRebuy 人間プレイヤーがリバイを実行する
func (sd *ShortDeck) Reset() errorReset ゲーム初期化
### func (*ShortDeck) ResetProfile
func (sd *ShortDeck) ResetProfile()ResetProfile メタAIプロファイルをリセットする
func (sd *ShortDeck) Resize(players []*ShortDeckPlayer)Resize プレイヤースライスを差し替え、プレイヤー数依存スライスを再初期化する
### func (*ShortDeck) SetConfig
func (sd *ShortDeck) SetConfig(cfg ShortDeckConfig)SetConfig 設定変更
### func (*ShortDeck) ShowHand
func (sd *ShortDeck) ShowHand() errorShowHand 人間プレイヤーがハンドを公開する
### func (*ShortDeck) SkipAddon
func (sd *ShortDeck) SkipAddon() errorSkipAddon 人間プレイヤーがアドオンを辞退する
### func (*ShortDeck) SkipRebuy
func (sd *ShortDeck) SkipRebuy() errorSkipRebuy 人間プレイヤーがリバイを辞退する
### func (*ShortDeck) UnmarshalJSON
func (sd *ShortDeck) UnmarshalJSON(data []byte) errorUnmarshalJSON implements json.Unmarshaler.
ShortDeckConfig ショートデックホールデム設定 (HoldemConfigと同一構造)
type ShortDeckConfig = HoldemConfig### func DefaultShortDeckConfig
func DefaultShortDeckConfig() ShortDeckConfigDefaultShortDeckConfig デフォルト設定
ShortDeckCpuAction CPU行動記録
type ShortDeckCpuAction = HoldemCpuActionShortDeckPlayStyle CPUプレイスタイル (HoldemPlayStyleと同一)
type ShortDeckPlayStyle = HoldemPlayStyleShortDeckPlayer ショートデックホールデムプレイヤークラス
type ShortDeckPlayer struct {
Player // 親クラス
ChipHolder // チップ管理
// contains filtered or unexported fields
}func NewShortDeckPlayer(isHuman bool, style HoldemPlayStyle) *ShortDeckPlayerNewShortDeckPlayer コンストラクタ
### func NewShortDeckPlayersForTable
func NewShortDeckPlayersForTable(tableSize int) []*ShortDeckPlayerNewShortDeckPlayersForTable 指定されたテーブルサイズに応じたショートデックプレイヤースライスを生成する
### func (*ShortDeckPlayer) EvalBestHand
func (sp *ShortDeckPlayer) EvalBestHand(communityCards []*Card) intEvalBestHand コミュニティカードとホールカード(2枚)からベスト5枚を評価 (ショートデック用)
### func (*ShortDeckPlayer) GetAFDisplay
func (sp *ShortDeckPlayer) GetAFDisplay() stringGetAFDisplay AF表示文字列取得 (“-”=アクションなし, “∞”=コールなし, “X.X”=通常)
### func (*ShortDeckPlayer) GetBestHand
func (sp *ShortDeckPlayer) GetBestHand() []*CardGetBestHand ベストハンド取得
### func (*ShortDeckPlayer) GetComparisonCards
func (sp *ShortDeckPlayer) GetComparisonCards() []*CardGetComparisonCards ハンド比較用カード取得 (BettingPlayerインターフェース)
### func (*ShortDeckPlayer) GetIsHuman
func (sp *ShortDeckPlayer) GetIsHuman() boolGetIsHuman 人間フラグ取得
### func (*ShortDeckPlayer) GetPFR
func (sp *ShortDeckPlayer) GetPFR() intGetPFR PFR%取得 (0 if totalHands==0)
### func (*ShortDeckPlayer) GetPFRCount
func (sp *ShortDeckPlayer) GetPFRCount() intGetPFRCount PFR対象ハンド数取得
### func (*ShortDeckPlayer) GetPlayStyle
func (sp *ShortDeckPlayer) GetPlayStyle() HoldemPlayStyleGetPlayStyle プレイスタイル取得
### func (*ShortDeckPlayer) GetPlayStyleName
func (sp *ShortDeckPlayer) GetPlayStyleName() stringGetPlayStyleName プレイスタイル名取得
### func (*ShortDeckPlayer) GetPostFlopBetRaise
func (sp *ShortDeckPlayer) GetPostFlopBetRaise() intGetPostFlopBetRaise ポストフロップ ベット+レイズ回数取得
### func (*ShortDeckPlayer) GetPostFlopCall
func (sp *ShortDeckPlayer) GetPostFlopCall() intGetPostFlopCall ポストフロップ コール回数取得
### func (*ShortDeckPlayer) GetThreeBet
func (sp *ShortDeckPlayer) GetThreeBet() intGetThreeBet 3Bet%取得 (0 if threeBetOpportunity==0)
### func (*ShortDeckPlayer) GetThreeBetCount
func (sp *ShortDeckPlayer) GetThreeBetCount() intGetThreeBetCount 3Bet実行数取得
### func (*ShortDeckPlayer) GetThreeBetOpportunity
func (sp *ShortDeckPlayer) GetThreeBetOpportunity() intGetThreeBetOpportunity 3Bet機会数取得
### func (*ShortDeckPlayer) GetTotalHands
func (sp *ShortDeckPlayer) GetTotalHands() intGetTotalHands 総ハンド数取得
### func (*ShortDeckPlayer) GetVPIP
func (sp *ShortDeckPlayer) GetVPIP() intGetVPIP VPIP%取得 (0 if totalHands==0)
### func (*ShortDeckPlayer) GetVPIPCount
func (sp *ShortDeckPlayer) GetVPIPCount() intGetVPIPCount 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) errorUnmarshalJSON implements json.Unmarshaler.
ShortDeckResult ショーダウン結果
type ShortDeckResult = HoldemResultShortDeckSidePot サイドポット (共通SidePot型のエイリアス)
type ShortDeckSidePot = SidePotSidePot サイドポット (Poker/Holdem共通)
type SidePot struct {
Amount int // ポット額
EligiblePlayers []int // 受取対象プレイヤーインデックス
}func CalculateSidePots(players []BettingPlayer, pot int, startingChips []int) []SidePotCalculateSidePots サイドポット計算
Spades スペードゲームクラス
type Spades struct {
// contains filtered or unexported fields
}func NewSpades(trumpCards *TrumpCards, players []*SpadesPlayer, config SpadesConfig) *SpadesNewSpades コンストラクタ
func (s *Spades) CpuBid()CpuBid 現在のビッドプレイヤーがCPUの場合にビッドする
func (s *Spades) CpuPlay()CpuPlay 現在の手番がCPUの場合に1ターン実行
### func (*Spades) GetActionLog
func (s *Spades) GetActionLog() []*ActionLogEntryGetActionLog 棋譜取得
### func (*Spades) GetBidPlayerIdx
func (s *Spades) GetBidPlayerIdx() intGetBidPlayerIdx ビッドプレイヤーインデックス取得
func (s *Spades) GetConfig() SpadesConfigGetConfig 設定取得
### func (*Spades) GetCurrentPlayerIdx
func (s *Spades) GetCurrentPlayerIdx() intGetCurrentPlayerIdx 現在のプレイヤーインデックス取得
### func (*Spades) GetCurrentTrick
func (s *Spades) GetCurrentTrick() []*SpadesTrickCardGetCurrentTrick 現在のトリック取得
### func (*Spades) GetGameEndFlag
func (s *Spades) GetGameEndFlag() boolGetGameEndFlag ゲーム終了フラグ取得
func (s *Spades) GetHint() *SpadesHintGetHint ヒントを取得する
### func (*Spades) GetLeadPlayerIdx
func (s *Spades) GetLeadPlayerIdx() intGetLeadPlayerIdx リードプレイヤーインデックス取得
func (s *Spades) GetPhase() SpadesPhaseGetPhase 現在のフェーズ取得
func (s *Spades) GetPlayer(i int) *SpadesPlayerGetPlayer プレイヤー取得
### func (*Spades) GetPlayerCnt
func (s *Spades) GetPlayerCnt() intGetPlayerCnt プレイヤー数取得
### func (*Spades) GetRoundNumber
func (s *Spades) GetRoundNumber() intGetRoundNumber 現在のラウンド番号取得
### func (*Spades) GetSpadesBroken
func (s *Spades) GetSpadesBroken() boolGetSpadesBroken スペードブレイク状態取得
### func (*Spades) GetTrickNumber
func (s *Spades) GetTrickNumber() intGetTrickNumber 現在のトリック番号取得
### func (*Spades) GetValidPlayIndices
func (s *Spades) GetValidPlayIndices(playerIdx int) []intGetValidPlayIndices プレイ可能なカードのインデックスリストを返す (Web用)
### func (*Spades) GetWinnerIdx
func (s *Spades) GetWinnerIdx() intGetWinnerIdx 勝者インデックス取得 (-1 = 未確定)
### func (*Spades) IsHumanBidTurn
func (s *Spades) IsHumanBidTurn() boolIsHumanBidTurn 現在のビッド手番が人間かどうか
### func (*Spades) IsHumanTurn
func (s *Spades) IsHumanTurn() boolIsHumanTurn 現在の手番が人間かどうか
### func (*Spades) MarshalJSON
func (s *Spades) MarshalJSON() ([]byte, error)MarshalJSON implements json.Marshaler.
func (s *Spades) NextRound()NextRound 次のラウンドを開始する
func (s *Spades) NextTrick()NextTrick 次のトリックを開始する
func (s *Spades) PlayerBid(bid int) errorPlayerBid 人間プレイヤーがビッドする
func (s *Spades) PlayerPlay(cardIndex int) errorPlayerPlay 人間プレイヤーがカードをプレイする
func (s *Spades) Reset()Reset ゲーム初期化
### func (*Spades) ResolveTrick
func (s *Spades) ResolveTrick()ResolveTrick トリックを解決して勝者を決定する
func (s *Spades) ScoreRound()ScoreRound ラウンドのスコアを確定し、ゲーム終了判定を行う
### func (*Spades) SetBidPlayerIdx
func (s *Spades) SetBidPlayerIdx(idx int)SetBidPlayerIdx ビッドプレイヤーインデックス設定 (テスト用)
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 (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) errorUnmarshalJSON implements json.Unmarshaler.
SpadesConfig スペードゲーム設定
type SpadesConfig struct {
CpuDifficulty SpadesCpuDifficulty `json:"cd"`
PointLimit int `json:"pl"` // ゲーム終了スコア (先に到達したプレイヤーが勝利)
NilBonus int `json:"nb"` // ニルビッド成功時のボーナス
BagPenaltyThreshold int `json:"bt"` // バッグペナルティの閾値 (累積10バッグごとに-100)
}func DefaultSpadesConfig() SpadesConfigDefaultSpadesConfig デフォルト設定を返す
### func (SpadesConfig) Validate
func (c SpadesConfig) Validate() errorValidate 設定値のドメインバリデーション
SpadesCpuDifficulty CPU の難易度レベル
type SpadesCpuDifficulty intconst (
// SpadesCpuDifficultyEasy 低難易度
SpadesCpuDifficultyEasy SpadesCpuDifficulty = iota
// SpadesCpuDifficultyNormal 中難易度
SpadesCpuDifficultyNormal
// SpadesCpuDifficultyHard 高難易度
SpadesCpuDifficultyHard
)SpadesHint ヒント情報
type SpadesHint struct {
CardIndex *int // 推奨カードインデックス (ビッド時nil)
Bid *int // 推奨ビッド値 (プレイ時nil)
Reason string // ヒント理由キー
}SpadesPhase ゲームフェーズ
type SpadesPhase intconst (
// SpadesPhaseBid ビッドフェーズ
SpadesPhaseBid SpadesPhase = 0
// SpadesPhasePlay トリックプレイフェーズ
SpadesPhasePlay SpadesPhase = 1
// SpadesPhaseTrickEnd トリック終了フェーズ
SpadesPhaseTrickEnd SpadesPhase = 2
// SpadesPhaseRoundEnd ラウンド終了フェーズ
SpadesPhaseRoundEnd SpadesPhase = 3
// SpadesPhaseGameEnd ゲーム終了フェーズ
SpadesPhaseGameEnd SpadesPhase = 4
)SpadesPlayer スペードプレイヤークラス
type SpadesPlayer struct {
*GamePlayer
RoundScoreHolder
TrickHolder
// contains filtered or unexported fields
}func NewSpadesPlayer(isHuman bool) *SpadesPlayerNewSpadesPlayer コンストラクタ
### func (*SpadesPlayer) GetBags
func (p *SpadesPlayer) GetBags() intGetBags 累積バッグ数を取得
### func (*SpadesPlayer) GetBid
func (p *SpadesPlayer) GetBid() intGetBid ビッド取得 (-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) errorUnmarshalJSON implements json.Unmarshaler.
SpadesTrickCard トリック中の1枚
type SpadesTrickCard struct {
PlayerIdx int `json:"pi"`
Card *Card `json:"c"`
}Speed スピードゲームクラス
type Speed struct {
// contains filtered or unexported fields
}func NewSpeed(trumpCards *TrumpCards, players []*SpeedPlayer, config SpeedConfig) *SpeedNewSpeed コンストラクタ
func (s *Speed) CanPlay(playerIdx, cardIdx, pileIdx int) boolCanPlay 指定プレイヤーの手札カードが指定台札に出せるか
func (s *Speed) CpuPlay() []*SpeedCpuActionCpuPlay CPUがカードを出す (難易度に応じて複数枚)
func (s *Speed) Flip() errorFlip 膠着時に台札をめくる
### func (*Speed) GetActionLog
func (s *Speed) GetActionLog() []*ActionLogEntryGetActionLog 棋譜取得
### func (*Speed) GetCenterPile
func (s *Speed) GetCenterPile(i int) *CardGetCenterPile 台札取得
func (s *Speed) GetConfig() SpeedConfigGetConfig 設定取得
### func (*Speed) GetGameEndFlag
func (s *Speed) GetGameEndFlag() boolGetGameEndFlag ゲーム終了フラグ取得
func (s *Speed) GetHint() (cardIdx, pileIdx int, found bool)GetHint 人間プレイヤーへのヒントを返す
func (s *Speed) GetPhase() SpeedPhaseGetPhase フェーズ取得
func (s *Speed) GetPlayer(i int) *SpeedPlayerGetPlayer プレイヤー取得
### func (*Speed) GetPlayerCnt
func (s *Speed) GetPlayerCnt() intGetPlayerCnt プレイヤー数取得
### func (*Speed) GetWinnerIdx
func (s *Speed) GetWinnerIdx() intGetWinnerIdx 勝者インデックス取得
func (s *Speed) IsHumanTurn() boolIsHumanTurn Speedでは常に人間のターン (同時プレイ)
func (s *Speed) IsStuck() boolIsStuck 膠着状態かどうか
func (s *Speed) MarshalJSON() ([]byte, error)MarshalJSON implements json.Marshaler.
### func (*Speed) PlayerHasAnyPlay
func (s *Speed) PlayerHasAnyPlay(playerIdx int) boolPlayerHasAnyPlay 指定プレイヤーに出せる手がある場合 true
func (s *Speed) PlayerPlay(cardIndex, pileIndex int) errorPlayerPlay 人間プレイヤーがカードを出す
func (s *Speed) Reset()Reset ゲームをリセットして新しいゲームを開始する
func (s *Speed) SetConfig(cfg SpeedConfig)SetConfig 設定更新
### func (*Speed) UnmarshalJSON
func (s *Speed) UnmarshalJSON(data []byte) errorUnmarshalJSON implements json.Unmarshaler.
func (s *Speed) UpdatePhase()UpdatePhase 外部からフェーズ更新 (Interactor用)
SpeedConfig スピードゲーム設定
type SpeedConfig struct {
CpuDifficulty SpeedCpuDifficulty
}func DefaultSpeedConfig() SpeedConfigDefaultSpeedConfig デフォルト設定を返す
### func (SpeedConfig) MarshalJSON
func (c SpeedConfig) MarshalJSON() ([]byte, error)MarshalJSON implements json.Marshaler.
### func (*SpeedConfig) UnmarshalJSON
func (c *SpeedConfig) UnmarshalJSON(data []byte) errorUnmarshalJSON implements json.Unmarshaler.
### func (SpeedConfig) Validate
func (c SpeedConfig) Validate() errorValidate 設定値の検証
SpeedCpuAction CPUが行ったアクション
type SpeedCpuAction struct {
CardIndex int // 手札インデックス (出した時点での)
PileIndex int // 台札インデックス
}SpeedCpuDifficulty CPUの難易度
type SpeedCpuDifficulty intconst (
// SpeedCpuDifficultyEasy ランダムに1枚だけ出す
SpeedCpuDifficultyEasy SpeedCpuDifficulty = iota
// SpeedCpuDifficultyNormal 貪欲に複数枚出す
SpeedCpuDifficultyNormal
// SpeedCpuDifficultyHard 貪欲+戦略的判断
SpeedCpuDifficultyHard
)SpeedPhase ゲームフェーズ
type SpeedPhase intconst (
// SpeedPhasePlay プレイフェーズ
SpeedPhasePlay SpeedPhase = 0
// SpeedPhaseStuck 膠着フェーズ (めくりが必要)
SpeedPhaseStuck SpeedPhase = 1
// SpeedPhaseGameEnd ゲーム終了
SpeedPhaseGameEnd SpeedPhase = 2
)SpeedPlayer スピードプレイヤークラス
type SpeedPlayer struct {
*GamePlayer
// contains filtered or unexported fields
}func NewSpeedPlayer(isHuman bool) *SpeedPlayerNewSpeedPlayer コンストラクタ
### func (*SpeedPlayer) AddToDrawPile
func (p *SpeedPlayer) AddToDrawPile(cards ...*Card)AddToDrawPile 山札にカードを追加する
### func (*SpeedPlayer) DrawToHand
func (p *SpeedPlayer) DrawToHand() boolDrawToHand 山札から1枚引いて手札に加える。山札が空なら false を返す。
### func (*SpeedPlayer) GetDrawPileSize
func (p *SpeedPlayer) GetDrawPileSize() intGetDrawPileSize 山札の枚数を返す
### func (*SpeedPlayer) HasCards
func (p *SpeedPlayer) HasCards() boolHasCards 手札または山札にカードが残っているか
### 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) errorUnmarshalJSON implements json.Unmarshaler.
Spider スパイダーソリティアゲームクラス
type Spider struct {
// contains filtered or unexported fields
}func NewSpider(trumpCards *TrumpCards) *SpiderNewSpider コンストラクタ
func (s *Spider) AllFaceUp() boolAllFaceUp 全カードが表向きかどうか
### func (*Spider) AutoComplete
func (s *Spider) AutoComplete() errorAutoComplete オートコンプリート(全カード表向きの場合に完成スートを自動除去)
func (s *Spider) CanUndo() boolCanUndo アンドゥ可能かどうか
func (s *Spider) Deal() errorDeal ストックからタブローに1枚ずつ配る
### func (*Spider) GetActionLog
func (s *Spider) GetActionLog() []*ActionLogEntryGetActionLog 棋譜取得
### func (*Spider) GetCompletedSuits
func (s *Spider) GetCompletedSuits() intGetCompletedSuits 完成スート数取得
### func (*Spider) GetDifficulty
func (s *Spider) GetDifficulty() SpiderDifficultyGetDifficulty 難易度取得
func (s *Spider) GetHint() *SpiderHintGetHint ヒントを取得
### func (*Spider) GetMoveCount
func (s *Spider) GetMoveCount() intGetMoveCount 移動回数取得
func (s *Spider) GetPhase() SpiderPhaseGetPhase フェーズ取得
func (s *Spider) GetScore() intGetScore スコア取得
### func (*Spider) GetStockCount
func (s *Spider) GetStockCount() intGetStockCount ストック枚数取得
func (s *Spider) GetTableau() [SpiderTableauCnt][]*SpiderTableauCardGetTableau タブロー取得
func (s *Spider) GiveUp()GiveUp ギブアップ
### func (*Spider) IsStalemate
func (s *Spider) IsStalemate() boolIsStalemate 手詰まり状態取得
### func (*Spider) MarshalJSON
func (s *Spider) MarshalJSON() ([]byte, error)MarshalJSON implements json.Marshaler.
### func (*Spider) MoveTableauToTableau
func (s *Spider) MoveTableauToTableau(fromCol, cardIndex, toCol int) errorMoveTableauToTableau タブロー間でカードを移動
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 (s *Spider) SetPhase(phase SpiderPhase)SetPhase フェーズ設定 (テスト用)
func (s *Spider) SetScore(score int)SetScore スコア設定 (テスト用)
func (s *Spider) SetStock(stock []*Card)SetStock ストック設定 (テスト用)
func (s *Spider) SetTableau(tableau [SpiderTableauCnt][]*SpiderTableauCard)SetTableau タブロー設定 (テスト用)
func (s *Spider) Undo() errorUndo 直前の操作を取り消す
func (s *Spider) UndoN(n int) errorUndoN n回連続でアンドゥを実行する。
### func (*Spider) UndoToEscape
func (s *Spider) UndoToEscape() intUndoToEscape 膠着状態から抜けるために必要なアンドゥ回数を返す。膠着状態でなければ0、脱出不可なら-1。
### func (*Spider) UnmarshalJSON
func (s *Spider) UnmarshalJSON(data []byte) errorUnmarshalJSON implements json.Unmarshaler.
SpiderConfig スパイダーソリティア設定
type SpiderConfig struct {
Difficulty SpiderDifficulty
}func DefaultSpiderConfig() SpiderConfigDefaultSpiderConfig デフォルト設定(1スート)
SpiderDifficulty スパイダーソリティア難易度
type SpiderDifficulty intconst (
// SpiderDifficulty1Suit 1スート(初級)
SpiderDifficulty1Suit SpiderDifficulty = 1
// SpiderDifficulty2Suit 2スート(中級)
SpiderDifficulty2Suit SpiderDifficulty = 2
// SpiderDifficulty4Suit 4スート(上級)
SpiderDifficulty4Suit SpiderDifficulty = 4
)SpiderHint ヒント
type SpiderHint struct {
FromCol int
CardIndex int
ToCol int
}SpiderPhase スパイダーソリティアゲームフェーズ
type SpiderPhase intconst (
// SpiderPhasePlaying プレイ中
SpiderPhasePlaying SpiderPhase = iota
// SpiderPhaseGameClear ゲームクリア
SpiderPhaseGameClear
// SpiderPhaseGameOver ゲームオーバー
SpiderPhaseGameOver
)SpiderTableauCard タブロー上のカード
type SpiderTableauCard struct {
Card *Card `json:"c"`
FaceUp bool `json:"f"`
}ThreeCard スリーカードポーカークラス
type ThreeCard struct {
// contains filtered or unexported fields
}func NewDefaultThreeCard() *ThreeCardNewDefaultThreeCard デフォルト設定のスリーカードポーカーを生成するファクトリ関数
func NewThreeCard(trumpCards *TrumpCards) *ThreeCardNewThreeCard コンストラクタ
func (tc *ThreeCard) Bet(ante, pairPlus int) errorBet アンテベット&カード配布
func (tc *ThreeCard) Fold() errorFold フォールド(アンテ没収、ペアプラスは別途評価)
### func (*ThreeCard) GetActionLog
func (tc *ThreeCard) GetActionLog() []*ActionLogEntryGetActionLog 棋譜を取得する
### func (*ThreeCard) GetAnteBet
func (tc *ThreeCard) GetAnteBet() intGetAnteBet アンテベット額
### func (*ThreeCard) GetAnteBonusPayout
func (tc *ThreeCard) GetAnteBonusPayout() intGetAnteBonusPayout アンテボーナス配当
### func (*ThreeCard) GetAntePayout
func (tc *ThreeCard) GetAntePayout() intGetAntePayout アンテ配当
### func (*ThreeCard) GetChips
func (tc *ThreeCard) GetChips() intGetChips チップ
### func (*ThreeCard) GetDealerHand
func (tc *ThreeCard) GetDealerHand() []*CardGetDealerHand ディーラーハンド取得
### func (*ThreeCard) GetDealerHandRank
func (tc *ThreeCard) GetDealerHandRank() intGetDealerHandRank ディーラーハンドランク
### func (*ThreeCard) GetDealerQualified
func (tc *ThreeCard) GetDealerQualified() boolGetDealerQualified ディーラークオリファイ
### func (*ThreeCard) GetGameEndFlag
func (tc *ThreeCard) GetGameEndFlag() boolGetGameEndFlag ゲーム終了フラグ
### func (*ThreeCard) GetPairPlusBet
func (tc *ThreeCard) GetPairPlusBet() intGetPairPlusBet ペアプラスベット額
### func (*ThreeCard) GetPairPlusPayout
func (tc *ThreeCard) GetPairPlusPayout() intGetPairPlusPayout ペアプラス配当
### func (*ThreeCard) GetPhase
func (tc *ThreeCard) GetPhase() intGetPhase 現在のフェーズ
### func (*ThreeCard) GetPlayBet
func (tc *ThreeCard) GetPlayBet() intGetPlayBet プレイベット額
### func (*ThreeCard) GetPlayPayout
func (tc *ThreeCard) GetPlayPayout() intGetPlayPayout プレイ配当
### func (*ThreeCard) GetPlayerHand
func (tc *ThreeCard) GetPlayerHand() []*CardGetPlayerHand プレイヤーハンド取得
### func (*ThreeCard) GetPlayerHandRank
func (tc *ThreeCard) GetPlayerHandRank() intGetPlayerHandRank プレイヤーハンドランク
### func (*ThreeCard) GetResult
func (tc *ThreeCard) GetResult() GameResultGetResult ゲーム結果
### func (*ThreeCard) GetTotalPayout
func (tc *ThreeCard) GetTotalPayout() intGetTotalPayout 合計配当
### func (*ThreeCard) MarshalJSON
func (tc *ThreeCard) MarshalJSON() ([]byte, error)MarshalJSON implements json.Marshaler.
func (tc *ThreeCard) Play() errorPlay プレイ(アンテと同額のプレイベットを置いて勝負)
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) errorUnmarshalJSON implements json.Unmarshaler.
TriPeaks トリピークスソリティアゲームクラス
type TriPeaks struct {
// contains filtered or unexported fields
}func NewTriPeaks(trumpCards *TrumpCards) *TriPeaksNewTriPeaks コンストラクタ
### func (*TriPeaks) AllRemoved
func (t *TriPeaks) AllRemoved() boolAllRemoved 全タブローカードが除去されたか
func (t *TriPeaks) CanUndo() boolCanUndo アンドゥ可能かどうか
func (t *TriPeaks) Draw() errorDraw ストックからウェイストにカードを引く
### func (*TriPeaks) GetActionLog
func (t *TriPeaks) GetActionLog() []*ActionLogEntryGetActionLog 棋譜取得
func (t *TriPeaks) GetHint() *TriPeaksHintGetHint ヒントを取得
### func (*TriPeaks) GetLayout
func (t *TriPeaks) GetLayout() [TriPeaksRowCnt][TriPeaksColCnt]*TriPeaksCardGetLayout レイアウト取得
### func (*TriPeaks) GetMoveCount
func (t *TriPeaks) GetMoveCount() intGetMoveCount 移動回数取得
func (t *TriPeaks) GetPhase() TriPeaksPhaseGetPhase フェーズ取得
### func (*TriPeaks) GetStockCount
func (t *TriPeaks) GetStockCount() intGetStockCount ストック枚数取得
func (t *TriPeaks) GetWaste() []*CardGetWaste ウェイスト取得
func (t *TriPeaks) GiveUp()GiveUp ギブアップ
### func (*TriPeaks) IsExposed
func (t *TriPeaks) IsExposed(row, col int) boolIsExposed カードが露出しているか (テスト用の公開版)
### func (*TriPeaks) IsStalemate
func (t *TriPeaks) IsStalemate() boolIsStalemate 手詰まり状態取得
### func (*TriPeaks) MarshalJSON
func (t *TriPeaks) MarshalJSON() ([]byte, error)MarshalJSON implements json.Marshaler.
func (t *TriPeaks) Remove(row, col int) errorRemove タブローのカードを除去
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 (t *TriPeaks) SetPhase(phase TriPeaksPhase)SetPhase フェーズ設定 (テスト用)
func (t *TriPeaks) SetStock(stock []*Card)SetStock ストック設定 (テスト用)
func (t *TriPeaks) SetWaste(waste []*Card)SetWaste ウェイスト設定 (テスト用)
func (t *TriPeaks) Undo() errorUndo 直前の操作を取り消す
func (t *TriPeaks) UndoN(n int) errorUndoN n回連続でアンドゥを実行する。
### func (*TriPeaks) UndoToEscape
func (t *TriPeaks) UndoToEscape() intUndoToEscape 膠着状態から抜けるために必要なアンドゥ回数を返す。膠着状態でなければ0、脱出不可なら-1。
### func (*TriPeaks) UnmarshalJSON
func (t *TriPeaks) UnmarshalJSON(data []byte) errorUnmarshalJSON implements json.Unmarshaler.
TriPeaksCard タブロー上のカード
type TriPeaksCard struct {
Card *Card `json:"c"`
Removed bool `json:"r"`
}TriPeaksHint ヒント
type TriPeaksHint struct {
Type string // "remove" or "draw"
Row int
Col int
}TriPeaksPhase トリピークスゲームフェーズ
type TriPeaksPhase intconst (
// TriPeaksPhasePlaying プレイ中
TriPeaksPhasePlaying TriPeaksPhase = iota
// TriPeaksPhaseGameClear ゲームクリア
TriPeaksPhaseGameClear
// TriPeaksPhaseGameOver ゲームオーバー
TriPeaksPhaseGameOver
)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() intGetTrickCount 獲得したトリック数を取得
### func (*TrickHolder) GetTricksTaken
func (h *TrickHolder) GetTricksTaken() [][]*CardGetTricksTaken 獲得したトリック一覧を取得
### 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) errorUnmarshalJSON implements json.Unmarshaler.
TrumpCards トランプカードクラス
type TrumpCards struct {
// contains filtered or unexported fields
}func NewTrumpCards(jokerCnt int) *TrumpCardsNewTrumpCards コンストラクタ
func NewTrumpCardsEuchre() *TrumpCardsNewTrumpCardsEuchre ユーカー用24枚デッキコンストラクタ 9,10,J,Q,K,A (値: 1,9,10,11,12,13) × 4スート = 24枚
### func NewTrumpCardsPinochle
func NewTrumpCardsPinochle() *TrumpCardsNewTrumpCardsPinochle ピノクル用48枚デッキコンストラクタ 9,10,J,Q,K,A (値: 1,9,10,11,12,13) × 4スート × 2セット = 48枚
### func NewTrumpCardsShortDeck
func NewTrumpCardsShortDeck() *TrumpCardsNewTrumpCardsShortDeck ショートデック(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) *TrumpCardsNewTrumpCardsWithDecks マルチデッキ対応コンストラクタ
### func NewTrumpCardsWithSuits
func NewTrumpCardsWithSuits(totalCards int, suits []int) *TrumpCardsNewTrumpCardsWithSuits スート指定マルチデッキコンストラクタ suits で指定されたスートのみを使い、合計 totalCards 枚のデッキを作成する。 各スートの13枚をラウンドロビンで繰り返し追加し、totalCards 枚に達したら停止する。
### func (*TrumpCards) DrawCard
func (t *TrumpCards) DrawCard() *CardDrawCard 山札配る
### func (*TrumpCards) GetRemainingCount
func (t *TrumpCards) GetRemainingCount() intGetRemainingCount 山札の残り枚数
### func (*TrumpCards) GetTotalCount
func (t *TrumpCards) GetTotalCount() intGetTotalCount 山札の総枚数
### 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) errorUnmarshalJSON implements json.Unmarshaler.
VideoPoker ビデオポーカークラス
type VideoPoker struct {
// contains filtered or unexported fields
}func NewDefaultVideoPoker() *VideoPokerNewDefaultVideoPoker デフォルト設定のビデオポーカー(Jacks or Better)を生成するファクトリ関数
### func NewDeucesWildVideoPoker
func NewDeucesWildVideoPoker() *VideoPokerNewDeucesWildVideoPoker Deuces Wildバリアントを生成するファクトリ関数
### func NewJokerPokerVideoPoker
func NewJokerPokerVideoPoker() *VideoPokerNewJokerPokerVideoPoker Joker Pokerバリアントを生成するファクトリ関数
func NewVideoPoker(trumpCards *TrumpCards, config *VideoPokerVariantConfig) *VideoPokerNewVideoPoker コンストラクタ
func (vp *VideoPoker) Bet(amount int) errorBet ベット&ディール(1〜5コイン)
### func (*VideoPoker) GetActionLog
func (vp *VideoPoker) GetActionLog() []*ActionLogEntryGetActionLog 棋譜を取得する
### func (*VideoPoker) GetBetAmount
func (vp *VideoPoker) GetBetAmount() intGetBetAmount ベット額
### func (*VideoPoker) GetChips
func (vp *VideoPoker) GetChips() intGetChips チップ
### func (*VideoPoker) GetGameEndFlag
func (vp *VideoPoker) GetGameEndFlag() boolGetGameEndFlag ゲーム終了フラグ
### func (*VideoPoker) GetHand
func (vp *VideoPoker) GetHand() []*CardGetHand ハンド取得
### func (*VideoPoker) GetHandName
func (vp *VideoPoker) GetHandName() stringGetHandName ハンド名
### func (*VideoPoker) GetHandRank
func (vp *VideoPoker) GetHandRank() intGetHandRank ハンドランク
### func (*VideoPoker) GetHeldIndices
func (vp *VideoPoker) GetHeldIndices() [VideoPokerHandSize]boolGetHeldIndices ホールドインデックス
### func (*VideoPoker) GetPayout
func (vp *VideoPoker) GetPayout() intGetPayout 配当金額
### func (*VideoPoker) GetPhase
func (vp *VideoPoker) GetPhase() intGetPhase 現在のフェーズ
### func (*VideoPoker) GetResult
func (vp *VideoPoker) GetResult() GameResultGetResult ゲーム結果
### func (*VideoPoker) GetVariantName
func (vp *VideoPoker) GetVariantName() stringGetVariantName バリアント名を取得する
func (vp *VideoPoker) Hold(indices []int) errorHold ホールド選択&ドロー(indicesはキープするカードの0-basedインデックス)
### func (*VideoPoker) MarshalJSON
func (vp *VideoPoker) MarshalJSON() ([]byte, error)MarshalJSON implements json.Marshaler.
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) errorUnmarshalJSON 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() *VideoPokerVariantConfigDeucesWildConfig はDeuces Wildバリアントの設定を返す
func JacksOrBetterConfig() *VideoPokerVariantConfigJacksOrBetterConfig はJacks or Betterバリアントの設定を返す
func JokerPokerConfig() *VideoPokerVariantConfigJokerPokerConfig はJoker Poker (Kings or Better)バリアントの設定を返す
WinnerFunc ポット勝者判定関数型
type WinnerFunc func(players []BettingPlayer, eligible []int) []intGenerated by gomarkdoc