diff --git a/RedumpTool/Features/BuildUrlFeature.cs b/RedumpTool/Features/BuildUrlFeature.cs
index 61ce15a..b5dc614 100644
--- a/RedumpTool/Features/BuildUrlFeature.cs
+++ b/RedumpTool/Features/BuildUrlFeature.cs
@@ -2,7 +2,6 @@ using System;
using SabreTools.CommandLine.Inputs;
using SabreTools.RedumpLib.Data;
using SabreTools.RedumpLib.RedumpOrg;
-using SabreTools.RedumpLib.RedumpOrg.Data;
namespace RedumpTool.Features
{
diff --git a/SabreTools.RedumpLib.Test/Data/ExtensionsTests.cs b/SabreTools.RedumpLib.Test/Data/ExtensionsTests.cs
index 1af9902..6e959e5 100644
--- a/SabreTools.RedumpLib.Test/Data/ExtensionsTests.cs
+++ b/SabreTools.RedumpLib.Test/Data/ExtensionsTests.cs
@@ -2541,5 +2541,68 @@ namespace SabreTools.RedumpLib.Test.Data
}
#endregion
+
+ #region Yes/No
+
+ ///
+ /// Check that every YesNo has a long name provided
+ ///
+ /// YesNo value to check
+ /// True to expect a null value, false otherwise
+ [Theory]
+ [MemberData(nameof(GenerateYesNoTestData))]
+ public void YesNo_LongName(YesNo? yesNo, bool expectNull)
+ {
+ string actual = yesNo.LongName();
+
+ if (expectNull)
+ Assert.Null(actual);
+ else
+ Assert.NotNull(actual);
+ }
+
+ [Theory]
+ [InlineData(true, YesNo.Yes)]
+ [InlineData(false, YesNo.No)]
+ [InlineData(null, YesNo.NULL)]
+ public void YesNo_ToYesNo_Boolean(bool? value, YesNo? expected)
+ {
+ YesNo? actual = value.ToYesNo();
+ Assert.Equal(expected, actual);
+ }
+
+ [Theory]
+ [InlineData("True", YesNo.Yes)]
+ [InlineData("true", YesNo.Yes)]
+ [InlineData("Yes", YesNo.Yes)]
+ [InlineData("yes", YesNo.Yes)]
+ [InlineData("False", YesNo.No)]
+ [InlineData("false", YesNo.No)]
+ [InlineData("No", YesNo.No)]
+ [InlineData("no", YesNo.No)]
+ [InlineData("INVALID", YesNo.NULL)]
+ [InlineData(null, YesNo.NULL)]
+ public void YesNo_ToYesNo_String(string? value, YesNo? expected)
+ {
+ YesNo? actual = value.ToYesNo();
+ Assert.Equal(expected, actual);
+ }
+
+ ///
+ /// Generate a test set of YesNo values
+ ///
+ /// MemberData-compatible list of YesNo values
+ public static TheoryData GenerateYesNoTestData()
+ {
+ var testData = new TheoryData() { { null, false } };
+ foreach (YesNo? yesNo in Enum.GetValues().Cast())
+ {
+ testData.Add(yesNo, false);
+ }
+
+ return testData;
+ }
+
+ #endregion
}
}
diff --git a/SabreTools.RedumpLib.Test/RedumpOrg/ExtensionsTests.cs b/SabreTools.RedumpLib.Test/RedumpOrg/ExtensionsTests.cs
index 4c56884..0af5c53 100644
--- a/SabreTools.RedumpLib.Test/RedumpOrg/ExtensionsTests.cs
+++ b/SabreTools.RedumpLib.Test/RedumpOrg/ExtensionsTests.cs
@@ -386,68 +386,5 @@ namespace SabreTools.RedumpLib.Test.RedumpOrg
}
#endregion
-
- #region Yes/No
-
- ///
- /// Check that every YesNo has a long name provided
- ///
- /// YesNo value to check
- /// True to expect a null value, false otherwise
- [Theory]
- [MemberData(nameof(GenerateYesNoTestData))]
- public void YesNo_LongName(YesNo? yesNo, bool expectNull)
- {
- string actual = yesNo.LongName();
-
- if (expectNull)
- Assert.Null(actual);
- else
- Assert.NotNull(actual);
- }
-
- [Theory]
- [InlineData(true, YesNo.Yes)]
- [InlineData(false, YesNo.No)]
- [InlineData(null, YesNo.NULL)]
- public void YesNo_ToYesNo_Boolean(bool? value, YesNo? expected)
- {
- YesNo? actual = value.ToYesNo();
- Assert.Equal(expected, actual);
- }
-
- [Theory]
- [InlineData("True", YesNo.Yes)]
- [InlineData("true", YesNo.Yes)]
- [InlineData("Yes", YesNo.Yes)]
- [InlineData("yes", YesNo.Yes)]
- [InlineData("False", YesNo.No)]
- [InlineData("false", YesNo.No)]
- [InlineData("No", YesNo.No)]
- [InlineData("no", YesNo.No)]
- [InlineData("INVALID", YesNo.NULL)]
- [InlineData(null, YesNo.NULL)]
- public void YesNo_ToYesNo_String(string? value, YesNo? expected)
- {
- YesNo? actual = value.ToYesNo();
- Assert.Equal(expected, actual);
- }
-
- ///
- /// Generate a test set of YesNo values
- ///
- /// MemberData-compatible list of YesNo values
- public static TheoryData GenerateYesNoTestData()
- {
- var testData = new TheoryData() { { null, false } };
- foreach (YesNo? yesNo in Enum.GetValues().Cast())
- {
- testData.Add(yesNo, false);
- }
-
- return testData;
- }
-
- #endregion
}
}
diff --git a/SabreTools.RedumpLib/RedumpOrg/Converters/YesNoConverter.cs b/SabreTools.RedumpLib/Converters/YesNoConverter.cs
similarity index 91%
rename from SabreTools.RedumpLib/RedumpOrg/Converters/YesNoConverter.cs
rename to SabreTools.RedumpLib/Converters/YesNoConverter.cs
index 8e55c79..9903a15 100644
--- a/SabreTools.RedumpLib/RedumpOrg/Converters/YesNoConverter.cs
+++ b/SabreTools.RedumpLib/Converters/YesNoConverter.cs
@@ -1,9 +1,9 @@
using System;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
-using SabreTools.RedumpLib.RedumpOrg.Data;
+using SabreTools.RedumpLib.Data;
-namespace SabreTools.RedumpLib.RedumpOrg.Converters
+namespace SabreTools.RedumpLib.Converters
{
///
/// Serialize YesNo enum values
diff --git a/SabreTools.RedumpLib/Data/Enumerations.cs b/SabreTools.RedumpLib/Data/Enumerations.cs
index 38bdd45..b2f640b 100644
--- a/SabreTools.RedumpLib/Data/Enumerations.cs
+++ b/SabreTools.RedumpLib/Data/Enumerations.cs
@@ -3673,4 +3673,19 @@ namespace SabreTools.RedumpLib.Data
[HumanReadable(LongName = "Other")]
Other,
};
+
+ ///
+ /// Generic yes/no values
+ ///
+ public enum YesNo
+ {
+ [HumanReadable(LongName = "Yes/No")]
+ NULL = 0,
+
+ [HumanReadable(LongName = "No")]
+ No = 1,
+
+ [HumanReadable(LongName = "Yes")]
+ Yes = 2,
+ }
}
diff --git a/SabreTools.RedumpLib/Data/Extensions.cs b/SabreTools.RedumpLib/Data/Extensions.cs
index 35ec8db..63f2364 100644
--- a/SabreTools.RedumpLib/Data/Extensions.cs
+++ b/SabreTools.RedumpLib/Data/Extensions.cs
@@ -1973,5 +1973,61 @@ namespace SabreTools.RedumpLib.Data
=> AttributeHelper.GetHumanReadableAttribute(category)?.LongName;
#endregion
+
+ #region Yes/No
+
+ ///
+ /// Get the string representation of the YesNo value
+ ///
+ ///
+ ///
+ public static string LongName(this YesNo? yesno)
+ => AttributeHelper.GetHumanReadableAttribute(yesno)?.LongName ?? "Yes/No";
+
+ ///
+ /// Get the YesNo enum value for a given nullable boolean
+ ///
+ /// Nullable boolean value to convert
+ /// YesNo represented by the nullable boolean, if possible
+ public static YesNo ToYesNo(this bool yesno)
+ {
+ return yesno switch
+ {
+ false => YesNo.No,
+ true => YesNo.Yes,
+ };
+ }
+
+ ///
+ /// Get the YesNo enum value for a given nullable boolean
+ ///
+ /// Nullable boolean value to convert
+ /// YesNo represented by the nullable boolean, if possible
+ public static YesNo? ToYesNo(this bool? yesno)
+ {
+ return yesno switch
+ {
+ false => YesNo.No,
+ true => YesNo.Yes,
+ _ => YesNo.NULL,
+ };
+ }
+
+ ///
+ /// Get the YesNo enum value for a given string
+ ///
+ /// String value to convert
+ /// YesNo represented by the string, if possible
+ public static YesNo? ToYesNo(this string? yesno)
+ {
+ return (yesno?.ToLowerInvariant()) switch
+ {
+ "no" or "false" => YesNo.No,
+ "yes" or "true" => YesNo.Yes,
+ _ => YesNo.NULL,
+ };
+ }
+
+ #endregion
}
}
diff --git a/SabreTools.RedumpLib/Data/Sections/CopyProtectionSection.cs b/SabreTools.RedumpLib/Data/Sections/CopyProtectionSection.cs
index fbccc91..b08ee90 100644
--- a/SabreTools.RedumpLib/Data/Sections/CopyProtectionSection.cs
+++ b/SabreTools.RedumpLib/Data/Sections/CopyProtectionSection.cs
@@ -1,8 +1,7 @@
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
-using SabreTools.RedumpLib.RedumpOrg.Converters;
-using SabreTools.RedumpLib.RedumpOrg.Data;
+using SabreTools.RedumpLib.Converters;
namespace SabreTools.RedumpLib.Data.Sections
{
diff --git a/SabreTools.RedumpLib/Data/Sections/EDCSection.cs b/SabreTools.RedumpLib/Data/Sections/EDCSection.cs
index a8e1657..43261bf 100644
--- a/SabreTools.RedumpLib/Data/Sections/EDCSection.cs
+++ b/SabreTools.RedumpLib/Data/Sections/EDCSection.cs
@@ -1,7 +1,6 @@
using System;
using Newtonsoft.Json;
-using SabreTools.RedumpLib.RedumpOrg.Converters;
-using SabreTools.RedumpLib.RedumpOrg.Data;
+using SabreTools.RedumpLib.Converters;
namespace SabreTools.RedumpLib.Data.Sections
{
diff --git a/SabreTools.RedumpLib/RedumpOrg/Data/Enumerations.cs b/SabreTools.RedumpLib/RedumpOrg/Data/Enumerations.cs
index 962d962..db43f0c 100644
--- a/SabreTools.RedumpLib/RedumpOrg/Data/Enumerations.cs
+++ b/SabreTools.RedumpLib/RedumpOrg/Data/Enumerations.cs
@@ -309,19 +309,4 @@ namespace SabreTools.RedumpLib.RedumpOrg.Data
[HumanReadable(ShortName = "XMID:", LongName = "XMID:")]
XMID,
}
-
- ///
- /// Generic yes/no values
- ///
- public enum YesNo
- {
- [HumanReadable(LongName = "Yes/No")]
- NULL = 0,
-
- [HumanReadable(LongName = "No")]
- No = 1,
-
- [HumanReadable(LongName = "Yes")]
- Yes = 2,
- }
}
diff --git a/SabreTools.RedumpLib/RedumpOrg/Data/Extensions.cs b/SabreTools.RedumpLib/RedumpOrg/Data/Extensions.cs
index 7637263..a3b89eb 100644
--- a/SabreTools.RedumpLib/RedumpOrg/Data/Extensions.cs
+++ b/SabreTools.RedumpLib/RedumpOrg/Data/Extensions.cs
@@ -310,62 +310,6 @@ namespace SabreTools.RedumpLib.RedumpOrg.Data
=> AttributeHelper.GetHumanReadableAttribute(siteCode)?.ShortName;
#endregion
-
- #region Yes/No
-
- ///
- /// Get the string representation of the YesNo value
- ///
- ///
- ///
- public static string LongName(this YesNo? yesno)
- => AttributeHelper.GetHumanReadableAttribute(yesno)?.LongName ?? "Yes/No";
-
- ///
- /// Get the YesNo enum value for a given nullable boolean
- ///
- /// Nullable boolean value to convert
- /// YesNo represented by the nullable boolean, if possible
- public static YesNo ToYesNo(this bool yesno)
- {
- return yesno switch
- {
- false => YesNo.No,
- true => YesNo.Yes,
- };
- }
-
- ///
- /// Get the YesNo enum value for a given nullable boolean
- ///
- /// Nullable boolean value to convert
- /// YesNo represented by the nullable boolean, if possible
- public static YesNo? ToYesNo(this bool? yesno)
- {
- return yesno switch
- {
- false => YesNo.No,
- true => YesNo.Yes,
- _ => YesNo.NULL,
- };
- }
-
- ///
- /// Get the YesNo enum value for a given string
- ///
- /// String value to convert
- /// YesNo represented by the string, if possible
- public static YesNo? ToYesNo(this string? yesno)
- {
- return (yesno?.ToLowerInvariant()) switch
- {
- "no" or "false" => YesNo.No,
- "yes" or "true" => YesNo.Yes,
- _ => YesNo.NULL,
- };
- }
-
- #endregion
}
#pragma warning restore IDE0072
}
diff --git a/SabreTools.RedumpLib/RedumpOrg/Discs.cs b/SabreTools.RedumpLib/RedumpOrg/Discs.cs
index df29fc5..28e1603 100644
--- a/SabreTools.RedumpLib/RedumpOrg/Discs.cs
+++ b/SabreTools.RedumpLib/RedumpOrg/Discs.cs
@@ -2,7 +2,6 @@ using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using SabreTools.RedumpLib.Data;
-using SabreTools.RedumpLib.RedumpOrg.Data;
using SabreTools.RedumpLib.Web;
namespace SabreTools.RedumpLib.RedumpOrg