Skip to content

Commit 79a347a

Browse files
housekeeping
1 parent 82e3f32 commit 79a347a

File tree

15 files changed

+41
-34
lines changed

15 files changed

+41
-34
lines changed

Code/MethodSystem/MethodDescriptors/IReferenceResolvingMethod.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ namespace SER.Code.MethodSystem.MethodDescriptors;
77
/// </summary>
88
public interface IReferenceResolvingMethod
99
{
10-
public Type ReferenceType { get; }
10+
public Type ResolvesReference { get; }
1111

1212
public static class Desc
1313
{
14-
public static string Get(IReferenceResolvingMethod method) => $"Extracts information from {method.ReferenceType.AccurateName} objects.";
14+
public static string Get(IReferenceResolvingMethod method) => $"Extracts information from {method.ResolvesReference.AccurateName} objects.";
1515
}
1616
}

Code/MethodSystem/Methods/DoorMethods/DoorInfoMethod.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace SER.Code.MethodSystem.Methods.DoorMethods;
1515
[UsedImplicitly]
1616
public class DoorInfoMethod : LiteralValueReturningMethod, IReferenceResolvingMethod
1717
{
18-
public Type ReferenceType => typeof(Door);
18+
public Type ResolvesReference => typeof(Door);
1919

2020
public override TypeOfValue LiteralReturnTypes => new TypesOfValue([
2121
typeof(TextValue),

Code/MethodSystem/Methods/HTTPMethods/JSONInfoMethod.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public class JSONInfoMethod : ReturningMethod, IReferenceResolvingMethod, ICanEr
1717

1818
public override TypeOfValue Returns { get; } = new UnknownTypeOfValue();
1919

20-
public Type ReferenceType { get; } = typeof(JObject);
20+
public Type ResolvesReference { get; } = typeof(JObject);
2121

2222
public string[] ErrorReasons { get; } =
2323
[

Code/MethodSystem/Methods/HealthMethods/DamageInfoMethod.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace SER.Code.MethodSystem.Methods.HealthMethods;
1414
[UsedImplicitly]
1515
public class DamageInfoMethod : ReturningMethod, IReferenceResolvingMethod, IAdditionalDescription
1616
{
17-
public Type ReferenceType => typeof(DamageHandlerBase);
17+
public Type ResolvesReference => typeof(DamageHandlerBase);
1818

1919
public override TypeOfValue Returns => new TypesOfValue([
2020
typeof(TextValue),

Code/MethodSystem/Methods/ItemMethods/ItemInfoMethod.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class ItemInfoMethod : ReturningMethod, IReferenceResolvingMethod
1515
{
1616
public override string Description => IReferenceResolvingMethod.Desc.Get(this);
1717

18-
public Type ReferenceType => typeof(Item);
18+
public Type ResolvesReference => typeof(Item);
1919

2020
public override TypeOfValue Returns => new TypesOfValue([
2121
typeof(TextValue),

Code/MethodSystem/Methods/NumberMethods/TryParseNumberMethod.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.NumberMethods;
1010

1111
[UsedImplicitly]
12-
public class TryParseNumberMethod : ReferenceReturningMethod<ParseResult<NumberValue>>
12+
public class TryParseNumberMethod : ReferenceReturningMethod<Result<NumberValue>>
1313
{
1414
public override string Description => "Tries to parse a given value to a number.";
1515

Code/MethodSystem/Methods/ParsingMethods/ParseResultMethod.cs renamed to Code/MethodSystem/Methods/ParsingMethods/ResultInfoMethod.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,35 +10,37 @@
1010
namespace SER.Code.MethodSystem.Methods.ParsingMethods;
1111

1212
[UsedImplicitly]
13-
public class ParseResultMethod : ReturningMethod, ICanError, IReferenceResolvingMethod
13+
public class ResultInfoMethod : ReturningMethod, ICanError, IReferenceResolvingMethod
1414
{
1515
public override string Description => "Returns information from the parsing result.";
1616

1717
public override TypeOfValue Returns => new UnknownTypeOfValue();
1818

19-
public Type ReferenceType => typeof(ParseResult);
19+
public Type ResolvesReference => typeof(Result);
2020

2121
public string[] ErrorReasons =>
2222
[
23-
"Tried to access the value when the parsing was not successful"
23+
"Tried to access the value when the result was not successful"
2424
];
2525

2626
public override Argument[] ExpectedArguments { get; } =
2727
[
28-
new ReferenceArgument<ParseResult>("parsing result"),
28+
new ReferenceArgument<Result>("parsing result"),
2929
new OptionsArgument("info",
3030
new("success", "Returns true if the parsing was successful"),
31+
new("failed", "Returns true if the parsing has failed"),
3132
new("value", "The value that got parsed")
3233
)
3334
];
3435

3536
public override void Execute()
3637
{
37-
var parseResult = Args.GetReference<ParseResult>("parsing result");
38+
var parseResult = Args.GetReference<Result>("parsing result");
3839
ReturnValue = Args.GetOption("info") switch
3940
{
4041
"success" => new BoolValue(parseResult.Success),
4142
"value" => parseResult.Value ?? throw new ScriptRuntimeError(this, ErrorReasons[0]),
43+
"failed" => new BoolValue(!parseResult.Success),
4244
_ => throw new AndrzejFuckedUpException()
4345
};
4446
}

Code/MethodSystem/Methods/PickupMethods/PickupInfoMethod.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public class PickupInfoMethod : ReturningMethod, IReferenceResolvingMethod
2323
typeof(NumberValue)
2424
]);
2525

26-
public Type ReferenceType => typeof(Pickup);
26+
public Type ResolvesReference => typeof(Pickup);
2727

2828
public override Argument[] ExpectedArguments { get; } =
2929
[

Code/MethodSystem/Methods/PlayerVariableMethods/GetPlayerFromReferenceMethod.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace SER.Code.MethodSystem.Methods.PlayerVariableMethods;
1111
[UsedImplicitly]
1212
public class GetPlayerFromReferenceMethod : ReturningMethod<PlayerValue>, IReferenceResolvingMethod
1313
{
14-
public Type ReferenceType => typeof(Player);
14+
public Type ResolvesReference => typeof(Player);
1515

1616
public override string Description =>
1717
"Returns a player variable with a single player from a reference.";

Code/MethodSystem/Methods/RespawnMethods/RespawnWaveInfoMethod.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ namespace SER.Code.MethodSystem.Methods.RespawnMethods;
1717
[UsedImplicitly]
1818
public class RespawnWaveInfoMethod : LiteralValueReturningMethod, IReferenceResolvingMethod
1919
{
20-
public Type ReferenceType => typeof(TimeBasedWave);
20+
public Type ResolvesReference => typeof(TimeBasedWave);
2121

2222
public override TypeOfValue LiteralReturnTypes => new TypesOfValue([
2323
typeof(NumberValue),
@@ -35,7 +35,7 @@ public class RespawnWaveInfoMethod : LiteralValueReturningMethod, IReferenceReso
3535
"maxWaveSize",
3636
"respawnTokens",
3737
"influence",
38-
"timeleft"
38+
"timeLeft"
3939
)
4040
];
4141

0 commit comments

Comments
 (0)