File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed
Code/MethodSystem/Methods/ParsingMethods Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change 1+ using JetBrains . Annotations ;
2+ using LabApi . Features . Wrappers ;
3+ using SER . Code . ArgumentSystem . Arguments ;
4+ using SER . Code . ArgumentSystem . BaseArguments ;
5+ using SER . Code . MethodSystem . BaseMethods ;
6+ using SER . Code . MethodSystem . MethodDescriptors ;
7+ using SER . Code . ValueSystem ;
8+ using Utils ;
9+
10+ namespace SER . Code . MethodSystem . Methods . ParsingMethods ;
11+
12+ [ UsedImplicitly ]
13+ public class ParsePlayersMethod : ReturningMethod < PlayerValue > , IAdditionalDescription
14+ {
15+ public override string Description => "Parses a string containing player IDs into a PlayerValue" ;
16+
17+ public string AdditionalDescription =>
18+ "It functions the same as most RA commands do e.g. \" 1.3.5.6\" would return a PlayerValue " +
19+ "containing players with the player IDs of 1,3,5 and 6." ;
20+
21+ public override Argument [ ] ExpectedArguments { get ; } =
22+ [
23+ new TextArgument ( "player IDs" )
24+ ] ;
25+
26+ public override void Execute ( )
27+ {
28+ var playersString = Args . GetText ( "player IDs" ) ;
29+ var playerHubs = RAUtils . ProcessPlayerIdOrNamesList (
30+ new ArraySegment < string > ( [ playersString ] ) ,
31+ 0 ,
32+ out _
33+ ) ;
34+ ReturnValue = new PlayerValue ( Player . Get ( playerHubs ) ) ;
35+ }
36+ }
You can’t perform that action at this time.
0 commit comments