Skip to content

Commit b193698

Browse files
Create SpawnDummyMethod.cs
1 parent bbcd663 commit b193698

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
using JetBrains.Annotations;
3+
using LabApi.Features.Wrappers;
4+
using NetworkManagerUtils.Dummies;
5+
using PlayerRoles;
6+
using SER.Code.ArgumentSystem.Arguments;
7+
using SER.Code.ArgumentSystem.BaseArguments;
8+
using SER.Code.MethodSystem.BaseMethods.Synchronous;
9+
10+
namespace SER.Code.MethodSystem.Methods.DummyMethods;
11+
12+
[UsedImplicitly]
13+
public class SpawnDummyMethod : SynchronousMethod
14+
{
15+
public override string Description => "Spawns a dummy";
16+
17+
public override Argument[] ExpectedArguments { get; } =
18+
[
19+
new TextArgument("name"),
20+
new EnumArgument<RoleTypeId>("role type")
21+
];
22+
23+
public override void Execute()
24+
{
25+
var name = Args.GetText("name");
26+
var roleType = Args.GetEnum<RoleTypeId>("role type");
27+
28+
var dummy = Player.Get(DummyUtils.SpawnDummy(name));
29+
dummy.SetRole(roleType);
30+
}
31+
}

0 commit comments

Comments
 (0)