internal void AddPlayer(InnerPlayerControl control) { var playerId = control.PlayerId; var playerInfo = new InnerPlayerInfo(control.PlayerId); if (_allPlayers.TryAdd(playerId, playerInfo)) { control.PlayerInfo = playerInfo; } }
internal InnerPlayerInfo?AddPlayer(InnerPlayerControl control) { var playerId = control.PlayerId; var playerInfo = new InnerPlayerInfo(control.PlayerId); if (_allPlayers.TryAdd(playerId, playerInfo)) { return(playerInfo); } return(null); }
internal void RemovePlayer(InnerPlayerControl control) { _allPlayers.TryRemove(control.PlayerInfo.PlayerId, out _); }