Skip to content

Commit dc7dfe2

Browse files
Update UCRRoleInfoMethod.cs
1 parent 23c32b9 commit dc7dfe2

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

Code/MethodSystem/Methods/UCRMethods/UCRRoleInfoMethod.cs

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
using JetBrains.Annotations;
2+
using PlayerRoles;
23
using SER.Code.ArgumentSystem.Arguments;
34
using SER.Code.ArgumentSystem.BaseArguments;
5+
using SER.Code.ArgumentSystem.Structures;
46
using SER.Code.Exceptions;
7+
using SER.Code.Extensions;
58
using SER.Code.MethodSystem.BaseMethods.Synchronous;
69
using SER.Code.MethodSystem.MethodDescriptors;
710
using SER.Code.MethodSystem.Structures;
@@ -14,8 +17,7 @@ namespace SER.Code.MethodSystem.Methods.UCRMethods;
1417
// ReSharper disable once InconsistentNaming
1518
public 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

Comments
 (0)