We've got enemies and movement!!

This commit is contained in:
Matt F 2026-05-12 22:18:23 -07:00
parent 42ee0bf65d
commit 3287e8ea43
26 changed files with 1409 additions and 161 deletions

View file

@ -48,6 +48,19 @@ namespace TD.Gameplay
public static PlayerSlot SlotForClient(ulong clientId)
=> GetForClient(clientId)?.Slot ?? PlayerSlot.None;
/// <summary>
/// Returns the <see cref="PlayerMatchState"/> whose assigned slot matches
/// <paramref name="slot"/>, or null if no connected client holds that slot.
/// O(n) over connected players (max 9) — acceptable for server-side use.
/// Used by <c>WaveManager</c> to resolve kill-gold recipients.
/// </summary>
public static PlayerMatchState GetForSlot(PlayerSlot slot)
{
foreach (var pms in s_byClientId.Values)
if (pms.Slot == slot) return pms;
return null;
}
/// <summary>
/// The local client's own state. Null on a dedicated server or before the
/// local player has spawned.