-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update MnemonicDB to 0.9.92 * Update to the fixed version of MnemonicDB * Fix build failures
- Loading branch information
Showing
41 changed files
with
141 additions
and
160 deletions.
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
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
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
13 changes: 4 additions & 9 deletions
13
src/Abstractions/NexusMods.Abstractions.MnemonicDB.Attributes/BooleanAttribute.cs
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 |
---|---|---|
@@ -1,23 +1,18 @@ | ||
using NexusMods.MnemonicDB.Abstractions; | ||
using NexusMods.MnemonicDB.Abstractions.Attributes; | ||
using NexusMods.MnemonicDB.Abstractions.ElementComparers; | ||
using NexusMods.MnemonicDB.Abstractions.ValueSerializers; | ||
|
||
namespace NexusMods.Abstractions.MnemonicDB.Attributes; | ||
|
||
/// <summary> | ||
/// An attribute that represents a boolean value. | ||
/// </summary> | ||
public class BooleanAttribute(string ns, string name) : ScalarAttribute<bool, byte>(ValueTag.UInt8, ns, name) | ||
public class BooleanAttribute(string ns, string name) : ScalarAttribute<bool, byte, UInt8Serializer>(ns, name) | ||
{ | ||
/// <inheritdoc /> | ||
protected override byte ToLowLevel(bool value) | ||
{ | ||
return value ? (byte) 1 : (byte) 0; | ||
} | ||
protected override byte ToLowLevel(bool value) => value ? (byte) 1 : (byte) 0; | ||
|
||
/// <inheritdoc /> | ||
protected override bool FromLowLevel(byte value, AttributeResolver resolver) | ||
{ | ||
return value == 1; | ||
} | ||
protected override bool FromLowLevel(byte value, AttributeResolver resolver) => value == 1; | ||
} |
15 changes: 6 additions & 9 deletions
15
src/Abstractions/NexusMods.Abstractions.MnemonicDB.Attributes/ByteAttribute.cs
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 |
---|---|---|
@@ -1,21 +1,18 @@ | ||
using NexusMods.MnemonicDB.Abstractions; | ||
using NexusMods.MnemonicDB.Abstractions.Attributes; | ||
using NexusMods.MnemonicDB.Abstractions.ElementComparers; | ||
using NexusMods.MnemonicDB.Abstractions.ValueSerializers; | ||
|
||
namespace NexusMods.Abstractions.MnemonicDB.Attributes; | ||
|
||
/// <summary> | ||
/// Attribute for storing a UInt8 | ||
/// </summary> | ||
public class ByteAttribute(string ns, string name) : ScalarAttribute<byte, byte>(ValueTag.UInt8, ns, name) | ||
public class ByteAttribute(string ns, string name) : ScalarAttribute<byte, byte, UInt8Serializer>(ns, name) | ||
{ | ||
protected override byte ToLowLevel(byte value) | ||
{ | ||
return value; | ||
} | ||
/// <inheritdoc /> | ||
protected override byte ToLowLevel(byte value) => value; | ||
|
||
protected override byte FromLowLevel(byte value, AttributeResolver resolver) | ||
{ | ||
return value; | ||
} | ||
/// <inheritdoc /> | ||
protected override byte FromLowLevel(byte value, AttributeResolver resolver) => value; | ||
} |
3 changes: 2 additions & 1 deletion
3
src/Abstractions/NexusMods.Abstractions.MnemonicDB.Attributes/BytesAttribute.cs
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
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
14 changes: 5 additions & 9 deletions
14
src/Abstractions/NexusMods.Abstractions.MnemonicDB.Attributes/RelativePathAttribute.cs
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 |
---|---|---|
@@ -1,24 +1,20 @@ | ||
using NexusMods.MnemonicDB.Abstractions; | ||
using NexusMods.MnemonicDB.Abstractions.Attributes; | ||
using NexusMods.MnemonicDB.Abstractions.ElementComparers; | ||
using NexusMods.MnemonicDB.Abstractions.ValueSerializers; | ||
using NexusMods.Paths; | ||
|
||
namespace NexusMods.Abstractions.MnemonicDB.Attributes; | ||
|
||
/// <summary> | ||
/// Represents a relative path. | ||
/// </summary> | ||
public class RelativePathAttribute(string ns, string name) : ScalarAttribute<RelativePath, string>(ValueTag.Utf8Insensitive, ns, name) | ||
public class RelativePathAttribute(string ns, string name) : ScalarAttribute<RelativePath, string, Utf8InsensitiveSerializer>(ns, name) | ||
{ | ||
/// <inheritdoc /> | ||
protected override string ToLowLevel(RelativePath value) | ||
{ | ||
return value.Path; | ||
} | ||
protected override string ToLowLevel(RelativePath value) => value.Path; | ||
|
||
/// <inheritdoc /> | ||
protected override RelativePath FromLowLevel(string value, AttributeResolver resolver) | ||
{ | ||
return RelativePath.FromUnsanitizedInput(value); | ||
} | ||
protected override RelativePath FromLowLevel(string value, AttributeResolver resolver) | ||
=> RelativePath.FromUnsanitizedInput(value); | ||
} |
3 changes: 2 additions & 1 deletion
3
src/Abstractions/NexusMods.Abstractions.MnemonicDB.Attributes/SizeAttribute.cs
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
Oops, something went wrong.