diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index b25f69f..bd91310 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -29,7 +29,7 @@ jobs: - name: Install GitVersion uses: gittools/actions/gitversion/setup@v3.0.3 with: - versionSpec: '6.x' + versionSpec: '6.0.5' - name: Determine Version id: version_step # step id used as reference for output values uses: gittools/actions/gitversion/execute@v3.0.3 diff --git a/.github/workflows/ci-publish.yml b/.github/workflows/ci-publish.yml index ad2265e..7319925 100644 --- a/.github/workflows/ci-publish.yml +++ b/.github/workflows/ci-publish.yml @@ -51,7 +51,7 @@ jobs: - name: Install GitVersion uses: gittools/actions/gitversion/setup@v3.0.3 with: - versionSpec: '6.x' + versionSpec: '6.0.5' - name: Determine Version id: version_step # step id used as reference for output values uses: gittools/actions/gitversion/execute@v3.0.3 @@ -102,7 +102,7 @@ jobs: - name: Install GitVersion uses: gittools/actions/gitversion/setup@v3.0.3 with: - versionSpec: '6.x' + versionSpec: '6.0.5' - name: Determine Version id: version_step # step id used as reference for output values uses: gittools/actions/gitversion/execute@v3.0.3 diff --git a/Directory.Build.targets b/Directory.Build.targets index 1eb1e5a..f928110 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -5,5 +5,9 @@ + + + 0.0.0 + diff --git a/Directory.Packages.props b/Directory.Packages.props index 4888f7c..04212a1 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -2,9 +2,9 @@ - + - 2.64.1 + 2.70.0-alpha.2 all @@ -12,12 +12,12 @@ - - - - - - + + + + + + @@ -26,8 +26,8 @@ 13.0.3 - - + + diff --git a/Mutagen.Bethesda.Serialization.Newtonsoft/NewtonsoftJsonSerializationReaderKernel.cs b/Mutagen.Bethesda.Serialization.Newtonsoft/NewtonsoftJsonSerializationReaderKernel.cs index f5e1382..5907c5b 100644 --- a/Mutagen.Bethesda.Serialization.Newtonsoft/NewtonsoftJsonSerializationReaderKernel.cs +++ b/Mutagen.Bethesda.Serialization.Newtonsoft/NewtonsoftJsonSerializationReaderKernel.cs @@ -304,15 +304,47 @@ private void SkipArray(JsonReadingUnit reader) public float? ReadFloat(JsonReadingUnit reader) { SkipPropertyName(reader); - if (reader.Reader.Value is null or "") return null; - return (float)(double)reader.Reader.Value!; + switch (reader.Reader.Value) + { + case null: + case "": + return null; + case float f: + return f; + case double d: + return (float)d; + case decimal m: + return (float)m; + case int i: + return (float)i; + case long l: + return (float)l; + default: + throw new NotImplementedException(); + } } public double? ReadDouble(JsonReadingUnit reader) { SkipPropertyName(reader); - if (reader.Reader.Value is null or "") return null; - return (double)reader.Reader.Value!; + switch (reader.Reader.Value) + { + case null: + case "": + return null; + case float f: + return (double)f; + case double d: + return d; + case decimal m: + return (double)m; + case int i: + return (double)i; + case long l: + return (double)l; + default: + throw new NotImplementedException(); + } } public ModKey? ReadModKey(JsonReadingUnit reader) @@ -455,10 +487,9 @@ private void SkipArray(JsonReadingUnit reader) public Percent? ReadPercent(JsonReadingUnit reader) { - SkipPropertyName(reader); - if (reader.Reader.Value is null or "") return null; - var d = (double)reader.Reader.Value!; - return new Percent(d); + var d = ReadDouble(reader); + if (d == null) return null; + return new Percent(d.Value); } public TimeOnly? ReadTimeOnly(JsonReadingUnit reader) diff --git a/Mutagen.Bethesda.Serialization.SourceGenerator/Serialization/LoquiNameRetriever.cs b/Mutagen.Bethesda.Serialization.SourceGenerator/Serialization/LoquiNameRetriever.cs index f1a5d6c..f3a56c3 100644 --- a/Mutagen.Bethesda.Serialization.SourceGenerator/Serialization/LoquiNameRetriever.cs +++ b/Mutagen.Bethesda.Serialization.SourceGenerator/Serialization/LoquiNameRetriever.cs @@ -28,7 +28,7 @@ public Names GetNames(string name) { name = name.Substring(1); } - name = name.TrimEnd("Getter"); + name = name.TrimStringFromEnd("Getter"); return new Names( name, $"I{name}Getter", diff --git a/Mutagen.Bethesda.Serialization.SourceGenerator/Serialization/PropertyCollectionRetriever.cs b/Mutagen.Bethesda.Serialization.SourceGenerator/Serialization/PropertyCollectionRetriever.cs index b0fd3a9..a748a2c 100644 --- a/Mutagen.Bethesda.Serialization.SourceGenerator/Serialization/PropertyCollectionRetriever.cs +++ b/Mutagen.Bethesda.Serialization.SourceGenerator/Serialization/PropertyCollectionRetriever.cs @@ -89,7 +89,7 @@ private static void FillDefaults(LoquiTypeSet obj, PropertyCollection collection { if (!field.IsStatic || !field.IsReadOnly) continue; if (!field.Name.EndsWith("Default")) continue; - if (collection.Lookup.TryGetValue(field.Name.TrimEnd("Default"), out var prop)) + if (collection.Lookup.TryGetValue(field.Name.TrimStringFromEnd("Default"), out var prop)) { prop.Default = field; }