File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed
MethodSystem/Methods/PlayerMethods Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change 66using System . Collections . Generic ;
77
88namespace SER . MethodSystem . Methods . PlayerMethods ;
9+
910public 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}
You can’t perform that action at this time.
0 commit comments