43 lines
2.8 KiB
C#
43 lines
2.8 KiB
C#
using GeoSus.Client;
|
|
using System.Collections.Generic;
|
|
|
|
/// <summary>
|
|
/// Single source of truth for all in-game state on the client.
|
|
/// Updated exclusively by GameManager_Network; read by GameManager_UI.
|
|
/// </summary>
|
|
public class GameState
|
|
{
|
|
// ── Phase / Role ──────────────────────────────────────────────────────────
|
|
public GamePhase Phase { get; set; } = GamePhase.Lobby;
|
|
public PlayerRole? MyRole { get; set; }
|
|
public bool IsDead { get; set; }
|
|
|
|
// ── Tasks ─────────────────────────────────────────────────────────────────
|
|
public List<GameTask> MyTasks { get; set; } = new List<GameTask>();
|
|
public HashSet<string> MyCompletedTaskIds { get; set; } = new HashSet<string>();
|
|
public int TotalCompleted { get; set; }
|
|
public int TotalRequired { get; set; }
|
|
|
|
// ── Players ───────────────────────────────────────────────────────────────
|
|
public List<PlayerInfo> Players { get; set; } = new List<PlayerInfo>();
|
|
|
|
// ── Meeting ───────────────────────────────────────────────────────────────
|
|
public MeetingStartedPayload ActiveMeeting { get; set; }
|
|
public VotingClosedPayload LastVoteResult { get; set; }
|
|
public HashSet<string> VotedPlayerIds { get; set; } = new HashSet<string>();
|
|
|
|
// ── Sabotage ──────────────────────────────────────────────────────────────
|
|
public SabotageStartedPayload ActiveSabotage { get; set; }
|
|
|
|
// ── End game ──────────────────────────────────────────────────────────────
|
|
public GameEndedPayload GameEndData { get; set; }
|
|
|
|
// ── Kill cooldown (tracked by GameManager, reflected here for UI) ─────────
|
|
public float KillCooldownRemaining { get; set; }
|
|
|
|
// ── Notification (toast) ─────────────────────────────────────────────────
|
|
public string ToastMessage { get; set; }
|
|
public float ToastExpiry { get; set; } // UnityEngine.Time.time
|
|
}
|
|
|