import Foundation

/// Which game the coach is judging: a tournament, where the blinds climb and a stack gets short,
/// or a cash table, where everybody sits down a hundred big blinds deep and can buy back in.
///
/// The two are different games to coach. A twelve-big-blind stack is a push-or-fold spot at a
/// tournament and a player who has lost some of a buy-in at a cash table; a small pair facing a
/// raise is a fold at a tournament table that will be short in an hour and a call at a cash table
/// where the money behind pays for the times it hits. So the catalogue of habits, the rating
/// scale and the assessment's arrangements each come in two editions, and every reader of them
/// asks which edition through `LeakCatalogue.format`.
///
/// It is a process-wide setting for the same reason `AppVariant.current` is: one build is one
/// product, chosen once by the app shell before the first screen. The suite and the command line
/// run the tournament edition unless a test says otherwise, and the suite resets it before every
/// suite so a cash test cannot leave the switch thrown for the next one.
public enum CoachFormat: String, Sendable, CaseIterable {
    case tournament
    /// A cash table with a choice of bet size: no-limit or pot-limit.
    case cash
    /// A fixed-limit cash table. Bets come in one size and a round caps after a bet and three
    /// raises, so the price of a call is nearly always right, raising is how value is collected,
    /// and the expensive habits are folds — a draw let go for one small bet, a river folded to one
    /// bet in a pot of twelve. A third edition of everything, because none of the no-limit
    /// arithmetic about bet sizes applies.
    case limit

    /// Cash tables of either kind: everything that is true a hundred big blinds deep with blinds
    /// that never move, whatever the bet sizes.
    public var isCash: Bool { self != .tournament }
}
