Skip to content

Commit

Permalink
Renamed RoundTerrorists and RoundCounterTerrorists, made them private
Browse files Browse the repository at this point in the history
  • Loading branch information
B3none committed Jan 2, 2024
1 parent 3af4900 commit 5d46fbb
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions Modules/Managers/Queue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ public class Queue
public List<CCSPlayerController> QueuePlayers = new();
public List<CCSPlayerController> ActivePlayers = new();

public List<CCSPlayerController> RoundTerrorists = new();
public List<CCSPlayerController> RoundCounterTerrorists = new();

public Queue(int? retakesMaxPlayers, float? retakesTerroristRatio)
{
_maxRetakesPlayers = retakesMaxPlayers ?? 9;
Expand Down Expand Up @@ -59,11 +56,11 @@ public void PlayerTriedToJoinTeam(CCSPlayerController player, CsTeam fromTeam, C
}

if (
RoundTerrorists.Count > 0
&& RoundCounterTerrorists.Count > 0
_roundTerrorists.Count > 0
&& _roundCounterTerrorists.Count > 0
&& (
(toTeam == CsTeam.CounterTerrorist && !RoundCounterTerrorists.Contains(player))
|| (toTeam == CsTeam.Terrorist && !RoundTerrorists.Contains(player))
(toTeam == CsTeam.CounterTerrorist && !_roundCounterTerrorists.Contains(player))
|| (toTeam == CsTeam.Terrorist && !_roundTerrorists.Contains(player))
)
)
{
Expand Down Expand Up @@ -174,15 +171,18 @@ public void DebugQueues(bool isBefore)
}
}

private List<CCSPlayerController> _roundTerrorists = new();
private List<CCSPlayerController> _roundCounterTerrorists = new();

public void ClearRoundTeams()
{
RoundTerrorists.Clear();
RoundCounterTerrorists.Clear();
_roundTerrorists.Clear();
_roundCounterTerrorists.Clear();
}

public void SetRoundTeams()
{
RoundTerrorists = Utilities.GetPlayers().Where(player => Helpers.IsValidPlayer(player) && (CsTeam)player.TeamNum == CsTeam.Terrorist).ToList();
RoundCounterTerrorists = Utilities.GetPlayers().Where(player => Helpers.IsValidPlayer(player) && (CsTeam)player.TeamNum == CsTeam.CounterTerrorist).ToList();
_roundTerrorists = Utilities.GetPlayers().Where(player => Helpers.IsValidPlayer(player) && (CsTeam)player.TeamNum == CsTeam.Terrorist).ToList();
_roundCounterTerrorists = Utilities.GetPlayers().Where(player => Helpers.IsValidPlayer(player) && (CsTeam)player.TeamNum == CsTeam.CounterTerrorist).ToList();
}
}

0 comments on commit 5d46fbb

Please sign in to comment.