Code cleanup.

This commit is contained in:
2023-11-29 22:25:21 +08:00
parent d74db533dc
commit de1e9f9019
3 changed files with 6 additions and 4 deletions

View File

@@ -10,8 +10,8 @@ namespace Cryville.Crtr.Browsing {
internal static class ExtensionManager {
static readonly Dictionary<string, List<ResourceConverter>> _converters
= new Dictionary<string, List<ResourceConverter>>();
public static IEnumerable<string> GetSupportedFormats() {
return _converters.Keys;
public static ISet<string> GetSupportedFormats() {
return new HashSet<string>(_converters.Keys);
}
public static bool TryGetConverters(string extension, out IEnumerable<ResourceConverter> converters) {
List<ResourceConverter> outResult;

View File

@@ -20,7 +20,8 @@ namespace Cryville.Crtr.Browsing {
DirectoryInfo[] _filteredItems = new DirectoryInfo[0];
string _filter = string.Empty;
readonly List<string> _dirParts = new List<string>();
public IList<string> CurrentDirectory { get { return _dirParts.AsReadOnly(); } }
readonly IList<string> m_dirParts;
public IList<string> CurrentDirectory { get { return m_dirParts; } }
public int Count { get { return _filteredItems.Length; } }
static bool _init;
@@ -34,6 +35,7 @@ namespace Cryville.Crtr.Browsing {
_init = true;
ExtensionManager.Init(rootPath);
}
m_dirParts = _dirParts.AsReadOnly();
_watcher.Changed += OnFileChanged;
_watcher.Created += OnFileChanged;
_watcher.Deleted += OnFileChanged;

View File

@@ -57,7 +57,7 @@ namespace Cryville.Crtr {
static double renderStep = 0.05;
public static double actualRenderStep = 0;
static bool autoRenderStep = false;
public static float graphicalOffset = 0;
static float graphicalOffset = 0;
public static float soundOffset = 0;
static float startOffset = 0;
public static int areaJudgePrecision = 16;