Er spielt nicht, er liest nur mit - die Einschraenkung auf Cash NLH und Turniere gilt nur den Spielformaten (Owner 16.11.: "in swift gibts einen spectator mode in win nicht"). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
35 lines
1.9 KiB
C#
35 lines
1.9 KiB
C#
namespace Pokerfreak.Cockpit.Kern;
|
|
|
|
/// <summary>
|
|
/// Wie viel das Cockpit zeigt. Vorgabe: nur Cash Game NLH und
|
|
/// Turniere stehen (Owner 15.11.: "alle modi disablen außer cash und turniere, nur noch NLH"):
|
|
/// weg sind PLO, die Sonderformate (All-In or Fold, Bomb Pot, K-Poker),
|
|
/// Lehrer & Stimme, Streamer (samt Maus-Schalter) und das Klon-Abzeichen. Ausgeblendete Formate fliegen
|
|
/// auch aus der Wahl, damit der Laeufer sie nicht mehr spielt. Der Zuschauer bleibt (16.11.: er spielt
|
|
/// nicht, er liest nur mit). Übung bleibt, damit ein Start nicht nur
|
|
/// noch mit Echtgeld geht. (Spiegel: mac/Sources/Cockpit/Umfang.swift, cockpit/src/umfang.rs.)
|
|
/// Seit 15.11. 23:30 IMMER so (Owner, mehrfach: das Cockpit lief einmal ohne `--nur-spiel` aus der
|
|
/// Taskleiste und zeigte alles wieder). Nur `--alles` oder POKERFREAK_NUR_SPIEL=0 zeigt alles.
|
|
/// </summary>
|
|
public static class Umfang
|
|
{
|
|
public static bool NurSpiel { get; } =
|
|
Bestimmen(Environment.GetCommandLineArgs(), Environment.GetEnvironmentVariable("POKERFREAK_NUR_SPIEL"));
|
|
|
|
/// <summary>An, ausser `--alles` oder POKERFREAK_NUR_SPIEL=0/nein/false (`--nur-spiel` bleibt erlaubt).</summary>
|
|
public static bool Bestimmen(IEnumerable<string> args, string? env) =>
|
|
!args.Contains("--alles") && env?.Trim().ToLowerInvariant() is not ("0" or "nein" or "false");
|
|
|
|
/// <summary>Ob ein Format gezeigt und gespielt wird. Freeroll und VIP sind Turnier-Typen.</summary>
|
|
public static bool Erlaubt(SpielFormat f) =>
|
|
!NurSpiel || f is SpielFormat.Cash or SpielFormat.Turnier or SpielFormat.Vip or SpielFormat.Freeroll;
|
|
|
|
/// <summary>Nicht erlaubte Formate aus der Wahl nehmen; true, wenn sich etwas aenderte.</summary>
|
|
public static bool Bereinigen(Spielplan w)
|
|
{
|
|
var weg = Formate.Alle.Where(f => !Erlaubt(f) && w.Anzahl(f) > 0).ToList();
|
|
foreach (var f in weg) w.Setzen(f, 0);
|
|
return weg.Count > 0;
|
|
}
|
|
}
|