Skip to content

Commit 5f9f7fc

Browse files
Create PickupExistsMethod.cs
1 parent cbe680b commit 5f9f7fc

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
using LabApi.Features.Wrappers;
2+
using Mirror;
3+
using SER.Code.ArgumentSystem.Arguments;
4+
using SER.Code.ArgumentSystem.BaseArguments;
5+
using SER.Code.MethodSystem.BaseMethods;
6+
using SER.Code.MethodSystem.MethodDescriptors;
7+
using SER.Code.ValueSystem;
8+
9+
namespace SER.Code.MethodSystem.Methods.PickupMethods;
10+
11+
public class PickupExistsMethod : ReturningMethod<BoolValue>
12+
{
13+
public override string Description => "Returns true if the provided pickup is still present on the server.";
14+
15+
public override Argument[] ExpectedArguments { get; } =
16+
[
17+
new ReferenceArgument<Pickup>("pickup reference")
18+
];
19+
20+
public override void Execute()
21+
{
22+
var pickup = Args.GetReference<Pickup>("pickup reference");
23+
ReturnValue = NetworkServer.spawned.ContainsValue(pickup.NetworkIdentity);
24+
}
25+
}

0 commit comments

Comments
 (0)