Adding Match State controller
This commit is contained in:
parent
c100db52e5
commit
abcefcd7f1
13 changed files with 445 additions and 99 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue