Skip to content

Commit ac56084

Browse files
Update ResetPlayerCommandCooldownMethod.cs
1 parent 4f19499 commit ac56084

1 file changed

Lines changed: 18 additions & 4 deletions

File tree

Code/MethodSystem/Methods/CommandMethods/ResetPlayerCommandCooldownMethod.cs

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,28 @@ public class ResetPlayerCommandCooldownMethod : SynchronousMethod
1313
public override Argument[] ExpectedArguments { get; } =
1414
[
1515
new ReferenceArgument<CustomCommandFlag.CustomCommand>("command"),
16-
new PlayerArgument("player")
16+
new PlayersArgument("players")
17+
{
18+
DefaultValue = new(null, "all players")
19+
}
1720
];
1821

1922
public override void Execute()
2023
{
21-
Args
24+
var dict = Args
2225
.GetReference<CustomCommandFlag.CustomCommand>("command")
23-
.NextEligibleDateForPlayer
24-
.Remove(Args.GetPlayer("player"));
26+
.NextEligibleDateForPlayer;
27+
28+
if (Args.GetPlayers("players") is { } players)
29+
{
30+
foreach (var player in players)
31+
{
32+
dict.Remove(player);
33+
}
34+
}
35+
else
36+
{
37+
dict.Clear();
38+
}
2539
}
2640
}

0 commit comments

Comments
 (0)