File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed
MethodSystem/Methods/PlayerMethods Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change 55using System . Collections . Generic ;
66
77namespace SER . MethodSystem . Methods . PlayerMethods ;
8+
89public class SetInfoAreaMethod : SynchronousMethod
910{
1011 public override string Description => "Sets InfoArea for specified players" ;
1112
12- public override Argument [ ] ExpectedArguments => [
13+ public override Argument [ ] ExpectedArguments =>
14+ [
1315 new PlayersArgument ( "players" ) ,
14- new EnumArgument < PlayerInfoArea > ( "infoarea " )
16+ new EnumArgument < PlayerInfoArea > ( "info area " )
1517 {
1618 ConsumesRemainingValues = true ,
1719 }
18- ] ;
20+ ] ;
1921
2022 public override void Execute ( )
2123 {
22- List < Player > pls = Args . GetPlayers ( "players" ) ;
23- PlayerInfoArea area = Args . GetEnum < PlayerInfoArea > ( "infoarea" ) ;
24- foreach ( Player p in pls )
25- {
26- p . InfoArea = area ;
27- }
24+ List < Player > players = Args . GetPlayers ( "players" ) ;
25+ PlayerInfoArea info = Args . GetEnum < PlayerInfoArea > ( "info area" ) ;
26+
27+ players . ForEach ( p => p . InfoArea = info ) ;
2828 }
2929}
You can’t perform that action at this time.
0 commit comments