mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2026-08-15 13:04:36 +00:00
Add English translations to DataPath comments
Updated comments to include English translations for clarity.
This commit is contained in:
parent
aa1b6f968e
commit
aee35c3f58
1 changed files with 9 additions and 6 deletions
|
|
@ -16,30 +16,33 @@ namespace MinecraftClient.Scripting
|
|||
|
||||
/// <summary>
|
||||
/// 初始化数据目录(修正版)
|
||||
/// Initialize the data directory (Revised version)
|
||||
/// 需要手动传入脚本文件名(不含.cs扩展名)
|
||||
/// Requires manually passing the script file name (without the .cs extension)
|
||||
/// </summary>
|
||||
/// <param name="scriptName">脚本文件名(不含扩展名)</param>
|
||||
/// <param name="scriptName">脚本文件名(不含扩展名)Script file name (without extension)</param>
|
||||
public static void Init(string scriptName)
|
||||
{
|
||||
if (string.IsNullOrEmpty(scriptName))
|
||||
throw new ArgumentNullException(nameof(scriptName), "脚本名称不能为空");
|
||||
throw new ArgumentNullException(nameof(scriptName), "Script name cannot be null or empty(脚本名称不能为空)");
|
||||
|
||||
// 计算路径
|
||||
// 计算路径 Calculate the path
|
||||
relativePath = scriptName;
|
||||
absolutePath = Path.Combine(AppContext.BaseDirectory, scriptName);
|
||||
|
||||
// 创建目录
|
||||
// 创建目录 Create the directory
|
||||
if (!Directory.Exists(absolutePath))
|
||||
Directory.CreateDirectory(absolutePath);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取路径
|
||||
/// Get the path
|
||||
/// </summary>
|
||||
public static string Get(PathType pathType = PathType.Relative)
|
||||
{
|
||||
if (string.IsNullOrEmpty(relativePath) || string.IsNullOrEmpty(absolutePath))
|
||||
throw new InvalidOperationException("请先调用DataPath.Init()初始化");
|
||||
throw new InvalidOperationException("Please call DataPath.Init() first to initialize(请先调用DataPath.Init()初始化)");
|
||||
|
||||
return pathType switch
|
||||
{
|
||||
|
|
@ -49,4 +52,4 @@ namespace MinecraftClient.Scripting
|
|||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue