File tree Expand file tree Collapse file tree
Code/MethodSystem/Methods/UCRMethods Expand file tree Collapse file tree 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 . Extensions ;
6+ using SER . Code . MethodSystem . BaseMethods . Synchronous ;
7+ using SER . Code . MethodSystem . Structures ;
8+ using SER . Code . ValueSystem ;
9+ using UncomplicatedCustomRoles . API . Features ;
10+
11+ namespace SER . Code . MethodSystem . Methods . UCRMethods ;
12+
13+ // ReSharper disable once InconsistentNaming
14+ [ UsedImplicitly ]
15+ public class GetPlayersWithUCRRoleMethod : ReturningMethod < PlayerValue > , IDependOnFramework
16+ {
17+ public IDependOnFramework . Type DependsOn => IDependOnFramework . Type . Ucr ;
18+
19+ public override string Description => "Gets all players who have a provided UCR role." ;
20+
21+ public override Argument [ ] ExpectedArguments { get ; } =
22+ [
23+ new IntArgument ( "role id" )
24+ ] ;
25+
26+ public override void Execute ( )
27+ {
28+ var id = Args . GetInt ( "role id" ) ;
29+ ReturnValue = Player . ReadyList
30+ . Where ( p => SummonedCustomRole . Get ( p ) ? . Role . Id == id )
31+ . ToPlayerValue ( ) ;
32+ }
33+ }
You can’t perform that action at this time.
0 commit comments