From 7007cdb5ac29a635affdcb22d39f676c883265cb Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Tue, 12 Mar 2024 22:26:54 -0400 Subject: [PATCH] Seal classes and fix extensions --- SabreTools.Core/DictionaryBaseExtensions.cs | 14 +++++++------- SabreTools.DatFiles/DatHeader.cs | 2 +- SabreTools.DatItems/Machine.cs | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/SabreTools.Core/DictionaryBaseExtensions.cs b/SabreTools.Core/DictionaryBaseExtensions.cs index 1aa1250b..1ce90790 100644 --- a/SabreTools.Core/DictionaryBaseExtensions.cs +++ b/SabreTools.Core/DictionaryBaseExtensions.cs @@ -49,9 +49,9 @@ namespace SabreTools.Core #region Conversion /// - /// Convert a DatItem to a Rom + /// Convert a DictionaryBase to a Rom /// - public static Rom? ConvertToRom(this DatItem? self) + public static Rom? ConvertToRom(this DictionaryBase? self) { // If the DatItem is missing, we can't do anything if (self == null) @@ -334,7 +334,7 @@ namespace SabreTools.Core /// /// Returns if any hashes exist /// - public static bool HasHashes(this DatItem self) + public static bool HasHashes(this DictionaryBase self) { return self switch { @@ -348,7 +348,7 @@ namespace SabreTools.Core /// /// Returns if all of the hashes are set to their 0-byte values or null /// - public static bool HasZeroHash(this DatItem self) + public static bool HasZeroHash(this DictionaryBase self) { return self switch { @@ -530,9 +530,9 @@ namespace SabreTools.Core #region Information Filling /// - /// Fill any missing size and hash information from another DatItem + /// Fill any missing size and hash information from another DictionaryBase /// - public static void FillMissingHashes(this DatItem? self, DatItem? other) + public static void FillMissingHashes(this DictionaryBase? self, DictionaryBase? other) { if (self == null || other == null) return; @@ -655,7 +655,7 @@ namespace SabreTools.Core /// /// Get unique duplicate suffix on name collision /// - public static string GetDuplicateSuffix(this DatItem? self) + public static string GetDuplicateSuffix(this DictionaryBase? self) { if (self == null) return string.Empty; diff --git a/SabreTools.DatFiles/DatHeader.cs b/SabreTools.DatFiles/DatHeader.cs index 2734dd92..fe9b0bcb 100644 --- a/SabreTools.DatFiles/DatHeader.cs +++ b/SabreTools.DatFiles/DatHeader.cs @@ -14,7 +14,7 @@ namespace SabreTools.DatFiles /// Represents all possible DAT header information /// [JsonObject("header"), XmlRoot("header")] - public class DatHeader : ModelBackedItem, ICloneable + public sealed class DatHeader : ModelBackedItem, ICloneable { #region Constants diff --git a/SabreTools.DatItems/Machine.cs b/SabreTools.DatItems/Machine.cs index 0c371b97..9a270e51 100644 --- a/SabreTools.DatItems/Machine.cs +++ b/SabreTools.DatItems/Machine.cs @@ -10,7 +10,7 @@ namespace SabreTools.DatItems /// Represents the information specific to a set/game/machine /// [JsonObject("machine"), XmlRoot("machine")] - public class Machine : ModelBackedItem, ICloneable + public sealed class Machine : ModelBackedItem, ICloneable { #region Constants