From f5bbb308078ebc2f7268689df74024e32822e113 Mon Sep 17 00:00:00 2001 From: ole kristian homelien Date: Sun, 24 Nov 2024 19:38:18 +0100 Subject: [PATCH] Cleanup --- .../PackFiles/PackFileContainerLoader.cs | 4 +-- .../SharedCore/ToolCreation/EditorDatabase.cs | 24 ----------------- .../ToolCreation/EditorInfoBuilder.cs | 27 +++++++++++++++++++ 3 files changed, 29 insertions(+), 26 deletions(-) diff --git a/Shared/SharedCore/PackFiles/PackFileContainerLoader.cs b/Shared/SharedCore/PackFiles/PackFileContainerLoader.cs index b35529aa0..4205559d9 100644 --- a/Shared/SharedCore/PackFiles/PackFileContainerLoader.cs +++ b/Shared/SharedCore/PackFiles/PackFileContainerLoader.cs @@ -9,7 +9,7 @@ namespace Shared.Core.PackFiles { public interface IPackFileContainerLoader { - PackFileContainer Load(string packFileSystemPath); + PackFileContainer? Load(string packFileSystemPath); PackFileContainer? LoadAllCaFiles(GameTypeEnum gameEnum); PackFileContainer LoadSystemFolderAsPackFileContainer(string packFileSystemPath); } @@ -58,7 +58,7 @@ void AddFolderContentToPackFile(PackFileContainer container, string folderPath, AddFolderContentToPackFile(container, folder, rootPath); } - public PackFileContainer Load(string packFileSystemPath) + public PackFileContainer? Load(string packFileSystemPath) { try { diff --git a/Shared/SharedCore/ToolCreation/EditorDatabase.cs b/Shared/SharedCore/ToolCreation/EditorDatabase.cs index bed1f7a93..c9b2efd19 100644 --- a/Shared/SharedCore/ToolCreation/EditorDatabase.cs +++ b/Shared/SharedCore/ToolCreation/EditorDatabase.cs @@ -6,33 +6,9 @@ namespace Shared.Core.ToolCreation { - public class EditorInfo - { - public record ExtentionInfo(string Extention, int Priority); - public EditorInfo(EditorEnums editorEnum, Type view, Type viewModel) - { - EditorEnum = editorEnum; - View = view; - ViewModel = viewModel; - } - public List Extensions { get; set; } = new List(); - public List FolderRules { get; set; } = new List(); - public string ToolbarName { get; set; } = ""; - public bool AddToolbarButton { get; set; } = false; - public bool IsToolbarButtonEnabled { get; set; } = false; - public EditorEnums EditorEnum { get; } - public Type View { get; } - public Type ViewModel { get; } - } - public static class EditorPriorites - { - public static int Low => 0; - public static int Default => 50; - public static int High => 100; - } public interface IEditorDatabase { diff --git a/Shared/SharedCore/ToolCreation/EditorInfoBuilder.cs b/Shared/SharedCore/ToolCreation/EditorInfoBuilder.cs index 45b6b2155..3beeb2ee9 100644 --- a/Shared/SharedCore/ToolCreation/EditorInfoBuilder.cs +++ b/Shared/SharedCore/ToolCreation/EditorInfoBuilder.cs @@ -1,5 +1,32 @@ namespace Shared.Core.ToolCreation { + public class EditorInfo + { + public record ExtentionInfo(string Extention, int Priority); + + public EditorInfo(EditorEnums editorEnum, Type view, Type viewModel) + { + EditorEnum = editorEnum; + View = view; + ViewModel = viewModel; + } + public List Extensions { get; set; } = new List(); + public List FolderRules { get; set; } = new List(); + public string ToolbarName { get; set; } = ""; + public bool AddToolbarButton { get; set; } = false; + public bool IsToolbarButtonEnabled { get; set; } = false; + public EditorEnums EditorEnum { get; } + public Type View { get; } + public Type ViewModel { get; } + } + + public static class EditorPriorites + { + public static int Low => 0; + public static int Default => 50; + public static int High => 100; + } + public class EditorInfoBuilder { protected EditorInfo _instance;