public void Add(PlayerInfo playerInfo) { Entity entity = GetPlayerEntity(playerInfo.UserID); Player player = new Player(m_Demo, entity, playerInfo); m_Players.Add(player); }
public void Add(int index, PlayerInfo playerInfo) { Entity entity = GetPlayerEntity(playerInfo.UserID); Player player = new Player(m_Demo, entity, playerInfo); if (index >= 0) { if (index < m_Players.Count) { m_Players[index] = player; } else { m_Players.Add(player); } } else { m_Players.Add(player); } }
public void Remove(int userID) { for (int i = 0; i < m_Players.Count; i++) { if (m_Players[i] != null) { if (m_Players[i].PlayerInfo.UserID == userID) { PlayerInfo playerInfo = m_Players[i].PlayerInfo; PlayerInfo newPlayerInfo = new PlayerInfo(-1, "Disconnected", playerInfo.GUID == "BOT", ""); Entity entity = GetPlayerEntity(playerInfo.UserID); Player player = new Player(m_Demo, entity, playerInfo); m_Players[i] = player; } } } }