Skip to content

Commit 8f25b95

Browse files
Update SetEmoteMethod.cs
1 parent fcb0298 commit 8f25b95

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

MethodSystem/Methods/PlayerMethods/SetEmoteMethod.cs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,22 @@
66
using System.Collections.Generic;
77

88
namespace SER.MethodSystem.Methods.PlayerMethods;
9+
910
public class SetEmoteMethod : SynchronousMethod
1011
{
1112
public override string Description => "Sets emotion for specified players";
1213

13-
public override Argument[] ExpectedArguments => [
14+
public override Argument[] ExpectedArguments =>
15+
[
1416
new PlayersArgument("players"),
1517
new EnumArgument<EmotionPresetType>("emotion")
16-
17-
];
18+
];
1819

1920
public override void Execute()
2021
{
21-
EmotionPresetType emo = Args.GetEnum<EmotionPresetType>("emotion");
22-
List<Player> pls = Args.GetPlayers("players");
23-
foreach(Player p in pls)
24-
{
25-
p.Emotion = emo;
26-
}
22+
List<Player> players = Args.GetPlayers("players");
23+
EmotionPresetType emotion = Args.GetEnum<EmotionPresetType>("emotion");
24+
25+
players.ForEach(p => p.Emotion = emotion);
2726
}
2827
}

0 commit comments

Comments
 (0)