Skip to content

Commit 6ab59ea

Browse files
committed
perf: 将 IResourcesService 接口改为显式实现
1 parent 8fab8c1 commit 6ab59ea

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Moder.Core/Services/GameResources/Base/ResourcesService.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ private void LogItemsSum()
5858
}
5959
}
6060

61-
public void Add(string folderOrFilePath)
61+
void IResourcesService.Add(string folderOrFilePath)
6262
{
6363
Logger.Debug("添加 Mod 资源: {FolderOrFilePath}", folderOrFilePath);
6464
Debug.Assert(File.Exists(folderOrFilePath), "必须为文件");
@@ -78,7 +78,7 @@ public void Add(string folderOrFilePath)
7878
Logger.Info("添加 Mod 资源成功: {FolderOrFilePath}", folderOrFilePath);
7979
}
8080

81-
public void Remove(string folderOrFilePath)
81+
void IResourcesService.Remove(string folderOrFilePath)
8282
{
8383
Logger.Debug("移除 Mod 资源: {FolderOrFilePath}", folderOrFilePath);
8484
if (Directory.Exists(folderOrFilePath))
@@ -91,7 +91,7 @@ var filePath in Directory.GetFileSystemEntries(
9191
)
9292
)
9393
{
94-
Remove(filePath);
94+
((IResourcesService)this).Remove(filePath);
9595
}
9696
}
9797

@@ -114,7 +114,7 @@ var filePath in Directory.GetFileSystemEntries(
114114
}
115115
}
116116

117-
public void Reload(string folderOrFilePath)
117+
void IResourcesService.Reload(string folderOrFilePath)
118118
{
119119
Logger.Debug("尝试重新加载 Mod 资源: {FolderOrFilePath}", folderOrFilePath);
120120
if (Directory.Exists(folderOrFilePath))
@@ -139,7 +139,7 @@ public void Reload(string folderOrFilePath)
139139
Logger.Info("{ServiceName} 重新加载 Mod 资源成功", ServiceName);
140140
}
141141

142-
public void Renamed(string oldPath, string newPath)
142+
void IResourcesService.Renamed(string oldPath, string newPath)
143143
{
144144
Logger.Debug("Mod 资源重命名: {OldPath} -> {NewPath}", oldPath, newPath);
145145
if (Directory.Exists(newPath))

0 commit comments

Comments
 (0)