File tree Expand file tree Collapse file tree
Code/ArgumentSystem/Arguments Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ using JetBrains . Annotations ;
2+ using LabApi . Features . Enums ;
3+ using LabApi . Features . Wrappers ;
4+ using MapGeneration ;
5+ using SER . Code . ArgumentSystem . BaseArguments ;
6+ using SER . Code . Extensions ;
7+ using SER . Code . Helpers . ResultSystem ;
8+ using SER . Code . TokenSystem . Tokens ;
9+ using SER . Code . ValueSystem ;
10+
11+ namespace SER . Code . ArgumentSystem . Arguments ;
12+
13+ public class GeneratorsArgument ( string name ) : EnumHandlingArgument ( name )
14+ {
15+ public override string InputDescription => $ "reference to { nameof ( Generator ) } or * for every generator";
16+
17+ [ UsedImplicitly ]
18+ public DynamicTryGet < Generator [ ] > GetConvertSolution ( BaseToken token )
19+ {
20+ if ( token is SymbolToken { IsJoker : true } )
21+ {
22+ return new ( ( ) => Generator . List . ToArray ( ) ) ;
23+ }
24+
25+ if ( ! token . CanReturn < ReferenceValue < Generator > > ( out var func ) )
26+ {
27+ return "Value is not a valid reference to a generator." ;
28+ }
29+
30+ return new ( ( ) => func ( ) . OnSuccess ( x => new [ ] { x . Value } ) ) ;
31+ }
32+ }
You can’t perform that action at this time.
0 commit comments