Files
mmintelandClaude Opus 5.5 83a31b3831 Mac-App: "Was spielen" mit Tischen je Format, "Formate im Vergleich"
A card per format with its table count under the plan tiles (unmeasured
formats are marked), the table tile shows the sum. Results show bb/100
per format with its 95 % span on a shared axis and the verdict, Practice
and Live separately.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 10:43:23 +01:00

67 lines
2.2 KiB
Swift

import Foundation
/// Was an einem Tisch gespielt wird - wie lesen/formate.py. Nicht der Modus (Übung/Live).
public enum SpielFormat: String, CaseIterable, Sendable, Identifiable {
case cash, aof, bombpot, turnier, kpoker, vip, freeroll
public var id: String { rawValue }
public var name: String {
switch self {
case .cash: "Cash"
case .aof: "All-In or Fold"
case .bombpot: "Bomb Pot"
case .turnier: "Turnier"
case .kpoker: "K-Poker"
case .vip: "VIP Arena"
case .freeroll: "Freerolls"
}
}
public var symbol: String {
switch self {
case .cash: "circle.circle"
case .aof: "bolt.fill"
case .bombpot: "flame.fill"
case .turnier: "trophy.fill"
case .kpoker: "keyboard"
case .vip: "crown.fill"
case .freeroll: "gift.fill"
}
}
}
/// Eine Zeile des Vergleichs je Format (wachstum.je_format): bb/100 mit 95-%-Spanne.
public struct FormatZeile: Decodable, Equatable, Sendable, Identifiable {
public var format: String
public var name: String
public var haende: Int
public var nettoBB: Double?
public var bb100: Double?
public var unten: Double?
public var oben: Double?
public var id: String { format }
enum CodingKeys: String, CodingKey { case format, name, haende, nettoBB = "netto_bb", bb100, unten, oben }
public init(from d: Decoder) throws {
let c = try d.container(keyedBy: CodingKeys.self)
format = c.text(.format) ?? "unbekannt"; name = c.text(.name) ?? format
haende = c.zahl(.haende).map { Int($0) } ?? 0; nettoBB = c.zahl(.nettoBB)
bb100 = c.zahl(.bb100); unten = c.zahl(.unten); oben = c.zahl(.oben)
}
}
/// Welches Format vorn liegt - nur wenn die Spannen es tragen (betrieb/statistik.bestes_format).
public struct FormatUrteil: Decodable, Equatable, Sendable {
public var format: String?
public var grund: String
enum CodingKeys: String, CodingKey { case format, grund }
public init(from d: Decoder) throws {
let c = try d.container(keyedBy: CodingKeys.self)
format = c.text(.format); grund = c.text(.grund) ?? ""
}
}