2023-08-01 22:11:52 +03:00
|
|
|
|
namespace BattleBitAPI.Server
|
|
|
|
|
{
|
2023-08-11 11:04:47 +03:00
|
|
|
|
public class GamemodeRotation<TPlayer> where TPlayer : Player<TPlayer>
|
2023-08-01 22:11:52 +03:00
|
|
|
|
{
|
2023-08-11 11:04:47 +03:00
|
|
|
|
private GameServer<TPlayer>.Internal mResources;
|
|
|
|
|
public GamemodeRotation(GameServer<TPlayer>.Internal resources)
|
2023-08-01 22:11:52 +03:00
|
|
|
|
{
|
|
|
|
|
mResources = resources;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public IEnumerable<string> GetGamemodeRotation()
|
|
|
|
|
{
|
2023-08-11 11:04:47 +03:00
|
|
|
|
lock (mResources._GamemodeRotation)
|
|
|
|
|
return new List<string>(mResources._GamemodeRotation);
|
2023-08-01 22:11:52 +03:00
|
|
|
|
}
|
|
|
|
|
public bool InRotation(string gamemode)
|
|
|
|
|
{
|
2023-08-11 11:04:47 +03:00
|
|
|
|
lock (mResources._GamemodeRotation)
|
|
|
|
|
return mResources._GamemodeRotation.Contains(gamemode);
|
2023-08-01 22:11:52 +03:00
|
|
|
|
}
|
|
|
|
|
public bool RemoveFromRotation(string gamemode)
|
|
|
|
|
{
|
2023-08-11 11:04:47 +03:00
|
|
|
|
lock (mResources._GamemodeRotation)
|
|
|
|
|
if (!mResources._GamemodeRotation.Remove(gamemode))
|
2023-08-01 22:11:52 +03:00
|
|
|
|
return false;
|
|
|
|
|
mResources.GamemodeRotationDirty = true;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
public bool AddToRotation(string gamemode)
|
|
|
|
|
{
|
2023-08-11 11:04:47 +03:00
|
|
|
|
lock (mResources._GamemodeRotation)
|
|
|
|
|
if (!mResources._GamemodeRotation.Add(gamemode))
|
2023-08-01 22:11:52 +03:00
|
|
|
|
return false;
|
|
|
|
|
mResources.GamemodeRotationDirty = true;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
2023-08-11 11:04:47 +03:00
|
|
|
|
|
|
|
|
|
public void Reset()
|
|
|
|
|
{
|
|
|
|
|
}
|
2023-08-01 22:11:52 +03:00
|
|
|
|
}
|
|
|
|
|
}
|