11using JetBrains . Annotations ;
2+ using PlayerRoles ;
23using SER . Code . ArgumentSystem . Arguments ;
34using SER . Code . ArgumentSystem . BaseArguments ;
5+ using SER . Code . ArgumentSystem . Structures ;
46using SER . Code . Exceptions ;
7+ using SER . Code . Extensions ;
58using SER . Code . MethodSystem . BaseMethods . Synchronous ;
69using SER . Code . MethodSystem . MethodDescriptors ;
710using SER . Code . MethodSystem . Structures ;
@@ -14,8 +17,7 @@ namespace SER.Code.MethodSystem.Methods.UCRMethods;
1417// ReSharper disable once InconsistentNaming
1518public class UCRRoleInfoMethod : LiteralValueReturningMethod , IReferenceResolvingMethod , IDependOnFramework
1619{
17- public Type ResolvesReference => Type . GetType ( "UncomplicatedCustomRoles.API.Interfaces.ICustomRole, UncomplicatedCustomRoles" )
18- ?? throw new AndrzejFuckedUpException ( "ucr ICustomRole missing" ) ;
20+ public Type ResolvesReference => typeof ( ICustomRole ) ;
1921
2022 public IDependOnFramework . Type DependsOn => IDependOnFramework . Type . Ucr ;
2123
@@ -28,8 +30,14 @@ public class UCRRoleInfoMethod : LiteralValueReturningMethod, IReferenceResolvin
2830
2931 public override Argument [ ] ExpectedArguments =>
3032 [
31- new LooseReferenceArgument ( "custom role reference" , ResolvesReference ) ,
32- new OptionsArgument ( "property" , "id" , "name" )
33+ new LooseReferenceArgument ( "custom role reference" , typeof ( ICustomRole ) ) ,
34+ new OptionsArgument ( "property" ,
35+ "id" ,
36+ "name" ,
37+ Option . Enum < RoleTypeId > ( "role" ) ,
38+ Option . Enum < Team > ( "team" ) ,
39+ Option . Enum < RoleTypeId > ( "roleAppearance" )
40+ )
3341 ] ;
3442
3543 public override void Execute ( )
@@ -40,6 +48,9 @@ public override void Execute()
4048 {
4149 "id" => new NumberValue ( role . Id ) ,
4250 "name" => new StaticTextValue ( role . Name ) ,
51+ "role" => role . Role . ToString ( ) . ToStaticTextValue ( ) ,
52+ "team" => role . Team . ToString ( ) . ToStaticTextValue ( ) ,
53+ "roleAppearance" => role . RoleAppearance . ToString ( ) . ToStaticTextValue ( ) ,
4354 _ => throw new AndrzejFuckedUpException ( )
4455 } ;
4556 }
0 commit comments