Adding Match State controller

This commit is contained in:
Matt F 2026-05-12 10:31:23 -07:00
parent c100db52e5
commit abcefcd7f1
13 changed files with 445 additions and 99 deletions

View file

@ -498,19 +498,7 @@ namespace TD.Gameplay
// ----- Player slot ------------------------------------------------
/// <summary>
/// Returns the local player's PlayerSlot.
/// STUB: same trivial mapping used elsewhere; replaced when MatchState lands.
/// </summary>
private static PlayerSlot GetLocalPlayerSlot()
{
var nm = Unity.Netcode.NetworkManager.Singleton;
if (nm == null || !nm.IsClient) return PlayerSlot.None;
ulong clientId = nm.LocalClientId;
byte slotByte = (byte)(clientId + 1);
if (slotByte < 1 || slotByte > 9) return PlayerSlot.None;
return (PlayerSlot)slotByte;
}
=> PlayerMatchState.Local?.Slot ?? PlayerSlot.None;
}
}