Skip to content

Commit 5c096e7

Browse files
rename collection methods
1 parent 9d9e16b commit 5c096e7

22 files changed

Lines changed: 51 additions & 58 deletions

Code/ContextSystem/Contexts/Control/AttemptStatement.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ public class AttemptStatement : StatementContext, IExtendableStatement, IKeyword
1818
public string[] Arguments => [];
1919
public string? Example =>
2020
"""
21-
&collection = EmptyCollection
21+
&collection = Coll.Empty
2222
# swallows the error (doesn't stop the script)
2323
attempt
24-
Print {CollectionFetch &collection 2}
24+
Print {Coll.Fetch &collection 2}
2525
# throws because there's nothing at index 2
2626
end
2727
""";

Code/ContextSystem/Contexts/Control/Loops/RepeatLoop.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ repeat 10
2626
2727
# ========================================
2828
# you can also use a variable to define the amount of times to repeat
29-
repeat {RandomNum 1 10 int}
29+
repeat {Random 1 10 int}
3030
Print "hi"
3131
end
3232

Code/ContextSystem/Contexts/Control/OnErrorStatement.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ public class OnErrorStatement : StatementContext, IStatementExtender, IKeywordCo
2121
public string[] Arguments => [];
2222
public string Example =>
2323
"""
24-
&collection = EmptyCollection
24+
&collection = Coll.Empty
2525
attempt
26-
Print {CollectionFetch &collection 2}
26+
Print {Coll.Fetch &collection 2}
2727
# ERROR: there's nothing at index 2
2828
2929
Print "Hello, world!"

Code/MethodSystem/BaseMethods/Method.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ protected Method()
3434
.Replace("_", " ")
3535
?? "Unknown";
3636

37-
var name = type.Name;
37+
var name = type.Name.Replace("_", ".");
3838
if (!name.EndsWith("Method"))
3939
{
4040
throw new AndrzejFuckedUpException($"Method class name '{name}' must end with 'Method'.");

Code/MethodSystem/Methods/CollectionVariableMethods/CollectionContainsMethod.cs renamed to Code/MethodSystem/Methods/CollectionVariableMethods/Coll_ContainsMethod.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
namespace SER.Code.MethodSystem.Methods.CollectionVariableMethods;
88

99
[UsedImplicitly]
10-
public class CollectionContainsMethod : ReturningMethod<BoolValue>
10+
// ReSharper disable once InconsistentNaming
11+
public class Coll_ContainsMethod : ReturningMethod<BoolValue>
1112
{
1213
public override string Description => "Returns true if the value exists in the collection";
1314

Code/MethodSystem/Methods/CollectionVariableMethods/EmptyCollectionMethod.cs renamed to Code/MethodSystem/Methods/CollectionVariableMethods/Coll_EmptyMethod.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
using SER.Code.ArgumentSystem.BaseArguments;
1+
using JetBrains.Annotations;
2+
using SER.Code.ArgumentSystem.BaseArguments;
23
using SER.Code.MethodSystem.BaseMethods.Synchronous;
34
using SER.Code.ValueSystem;
45

56
namespace SER.Code.MethodSystem.Methods.CollectionVariableMethods;
6-
public class EmptyCollectionMethod : ReturningMethod<CollectionValue>
7+
8+
[UsedImplicitly]
9+
// ReSharper disable once InconsistentNaming
10+
public class Coll_EmptyMethod : ReturningMethod<CollectionValue>
711
{
812
public override string Description => "Returns an empty collection.";
913

Code/MethodSystem/Methods/CollectionVariableMethods/CollectionFetchMethod.cs renamed to Code/MethodSystem/Methods/CollectionVariableMethods/Coll_FetchMethod.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
namespace SER.Code.MethodSystem.Methods.CollectionVariableMethods;
1010

1111
[UsedImplicitly]
12-
public class CollectionFetchMethod : ReturningMethod
12+
public class Coll_FetchMethod : ReturningMethod
1313
{
1414
public override string Description => "Returns a value from a collection variable at a given position.";
1515
public override TypeOfValue Returns => new UnknownTypeOfValue();

Code/MethodSystem/Methods/CollectionVariableMethods/CollectionInsertMethod.cs renamed to Code/MethodSystem/Methods/CollectionVariableMethods/Coll_InsertMethod.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
namespace SER.Code.MethodSystem.Methods.CollectionVariableMethods;
1010

1111
[UsedImplicitly]
12-
public class CollectionInsertMethod : SynchronousMethod, IAdditionalDescription
12+
// ReSharper disable once InconsistentNaming
13+
public class Coll_InsertMethod : SynchronousMethod, IAdditionalDescription
1314
{
1415
public override string Description => "Adds a value to a collection variable";
1516

Code/MethodSystem/Methods/CollectionVariableMethods/JoinCollectionsMethod.cs renamed to Code/MethodSystem/Methods/CollectionVariableMethods/Coll_JoinMethod.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
using SER.Code.ArgumentSystem.Arguments;
1+
using JetBrains.Annotations;
2+
using SER.Code.ArgumentSystem.Arguments;
23
using SER.Code.ArgumentSystem.BaseArguments;
34
using SER.Code.MethodSystem.BaseMethods.Synchronous;
45
using SER.Code.ValueSystem;
56

67
namespace SER.Code.MethodSystem.Methods.CollectionVariableMethods;
7-
public class JoinCollectionsMethod : ReturningMethod<CollectionValue>
8+
9+
[UsedImplicitly]
10+
// ReSharper disable once InconsistentNaming
11+
public class Coll_JoinMethod : ReturningMethod<CollectionValue>
812
{
913
public override string Description => "Returns a collection that has the combined values of all the given collections";
1014

Code/MethodSystem/Methods/CollectionVariableMethods/CollectionRemoveAtMethod.cs renamed to Code/MethodSystem/Methods/CollectionVariableMethods/Coll_RemoveAtMethod.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
namespace SER.Code.MethodSystem.Methods.CollectionVariableMethods;
99

1010
[UsedImplicitly]
11-
public class CollectionRemoveAtMethod : SynchronousMethod
11+
// ReSharper disable once InconsistentNaming
12+
public class Coll_RemoveAtMethod : SynchronousMethod
1213
{
1314
public override string Description => "Removes a value at the provided index from a collection variable";
1415

0 commit comments

Comments
 (0)