-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add map size validation to No unlimiter
- Loading branch information
1 parent
656bfa9
commit 2faf6a2
Showing
7 changed files
with
98 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
Rally: | ||
- [10, 18, 150] | ||
- [20, 18, 60] | ||
- [30, 18, 30] | ||
- [32, 12, 32] | ||
- [45, 18, 45] | ||
Island: | ||
- [36, 36, 36] | ||
- [45, 36, 45] | ||
Speed: | ||
- [10, 18, 150] | ||
- [20, 18, 60] | ||
- [30, 18, 30] | ||
- [32, 12, 32] | ||
- [45, 18, 45] | ||
Stadium: | ||
- [32, 32, 32] | ||
Coast: | ||
- [36, 36, 36] | ||
- [45, 36, 45] | ||
Alpine: | ||
- [10, 18, 150] | ||
- [20, 18, 60] | ||
- [30, 18, 30] | ||
- [32, 12, 32] | ||
- [45, 18, 45] | ||
Bay: | ||
- [36, 36, 36] | ||
- [45, 36, 45] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using GBX.NET; | ||
using TmEssentials; | ||
using YamlDotNet.Core; | ||
using YamlDotNet.Core.Events; | ||
using YamlDotNet.Serialization; | ||
|
||
namespace RandomizerTMF.Logic.TypeConverters; | ||
|
||
internal sealed class Int3Converter : IYamlTypeConverter | ||
{ | ||
public bool Accepts(Type type) => type == typeof(Int3) || type == typeof(Int3?); | ||
|
||
public object? ReadYaml(IParser parser, Type type) | ||
{ | ||
_ = parser.Consume<SequenceStart>(); | ||
|
||
var x = int.Parse(parser.Consume<Scalar>().Value); | ||
var y = int.Parse(parser.Consume<Scalar>().Value); | ||
var z = int.Parse(parser.Consume<Scalar>().Value); | ||
|
||
_ = parser.Consume<SequenceEnd>(); | ||
|
||
return new Int3(x, y, z); | ||
} | ||
|
||
public void WriteYaml(IEmitter emitter, object? value, Type type) | ||
{ | ||
if (value is null) | ||
{ | ||
emitter.Emit(new Scalar("~")); | ||
return; | ||
} | ||
|
||
var val = (Int3)value!; | ||
|
||
emitter.Emit(new SequenceStart(default, default, isImplicit: true, SequenceStyle.Flow)); | ||
emitter.Emit(new Scalar(val.X.ToString())); | ||
emitter.Emit(new Scalar(val.Y.ToString())); | ||
emitter.Emit(new Scalar(val.Z.ToString())); | ||
emitter.Emit(new SequenceEnd()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters