CLre/CLre_server/API/Synergy/Clients.cs

44 lines
1.1 KiB
C#
Raw Normal View History

using System.Collections.Generic;
namespace CLre_server.API.Synergy
{
public static class Clients
{
private static readonly List<int> clrePlayers = new List<int>();
private static readonly List<int> players = new List<int>();
internal static void RegisterCLreClient(int playerId)
{
clrePlayers.Add(playerId);
}
internal static void RegisterClient(int playerId)
{
players.Add(playerId);
}
internal static void RemoveClient(int playerId)
{
if (IsCLreClient(playerId))
{
clrePlayers.Remove(playerId);
}
players.Remove(playerId);
}
public static bool IsCLreClient(int playerId)
{
return clrePlayers.Contains(playerId);
}
public static bool IsConnected(int playerId)
{
return players.Contains(playerId);
}
public static IEnumerator<int> CLreClients()
{
return clrePlayers.GetEnumerator();
}
}
}