Skip to content

Commit efe6f41

Browse files
Create SetRadioRangeMethod.cs
1 parent 831e668 commit efe6f41

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+
using Exiled.API.Enums;
2+
using Exiled.API.Features.Items;
3+
using InventorySystem.Items.Radio;
4+
using JetBrains.Annotations;
5+
using SER.Code.ArgumentSystem.Arguments;
6+
using SER.Code.ArgumentSystem.BaseArguments;
7+
using SER.Code.Helpers;
8+
using SER.Code.MethodSystem.BaseMethods.Synchronous;
9+
using SER.Code.MethodSystem.Structures;
10+
using RadioItem = LabApi.Features.Wrappers.RadioItem;
11+
12+
namespace SER.Code.MethodSystem.Methods.ItemMethods;
13+
14+
[UsedImplicitly]
15+
public class SetRadioRangeMethod : SynchronousMethod, IDependOnFramework
16+
{
17+
public FrameworkBridge.Type DependsOn => FrameworkBridge.Type.Exiled;
18+
19+
public override string Description => "Sets the radio range of a specified radio item.";
20+
21+
public override Argument[] ExpectedArguments { get; } =
22+
[
23+
new ReferenceArgument<RadioItem>("radio"),
24+
new EnumArgument<RadioMessages.RadioRangeLevel>("new radio range")
25+
];
26+
27+
public override void Execute()
28+
{
29+
Args.GetReference<RadioItem>("radio").Base._rangeId = (byte)Args.GetEnum<RadioMessages.RadioRangeLevel>("new radio range");
30+
}
31+
}

0 commit comments

Comments
 (0)