We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent eda13e6 commit bf2f944Copy full SHA for bf2f944
MethodSystem/Methods/CollectionVariableMethods/CollectionLengthMethod.cs
@@ -0,0 +1,21 @@
1
+using SER.ArgumentSystem.Arguments;
2
+using SER.ArgumentSystem.BaseArguments;
3
+using SER.MethodSystem.BaseMethods;
4
+using SER.ValueSystem;
5
+
6
+namespace SER.MethodSystem.Methods.CollectionVariableMethods;
7
8
+public class CollectionLengthMethod : ReturningMethod<NumberValue>
9
+{
10
+ public override string? Description => "Returns the amount of items in a collection.";
11
12
+ public override Argument[] ExpectedArguments =>
13
+ [
14
+ new CollectionArgument("collection")
15
+ ];
16
17
+ public override void Execute()
18
+ {
19
+ ReturnValue = Args.GetCollection("collection").CastedValues.Length;
20
+ }
21
+}
0 commit comments