XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

XFEExtension.SpaceEngineers.ScriptingHelper

【DLL】太空工程师SpaceEngineer脚本依赖辅助

公开
关注 0 Fork 0 Star 0
UTF-8
using Sandbox.ModAPI.Ingame;

namespace XFEExtension.SpaceEngineers.ScriptingHelper;

/// <summary>
/// 定义了一个接口,提供了在游戏内脚本执行时调用的主入口点和保存状态的方法。<br/>
/// Defines an interface providing a main entry point for execution when the in-game script runs and a method for saving state.
/// </summary>
public interface IProgramBase
{
    /// <summary>
    /// 当游戏内脚本执行时调用。根据传入的参数和更新源执行相应的逻辑。<br/>
    /// Executes the main entry point for the program, processing the specified argument based on the provided update
    /// source.
    /// </summary>
    /// <param name="argument">需要处理的输入字符串。不能为空;表示要处理的命令或数据。<br/>The input string to be processed. Cannot be null; represents the command or data to handle.</param>
    /// <param name="updateSource">触发执行的更新源。决定如何解释和处理参数。<br/>The source of the update triggering the execution. Determines how the argument is interpreted and processed.</param>
    public void Main(string argument, UpdateType updateSource);

    /// <summary>
    /// 当游戏内脚本需要保存其状态时调用。可以在此方法中实现任何必要的逻辑来持久化数据,以便在脚本重新加载时恢复状态。<br/>
    /// Called when the program needs to save its state.
    /// </summary>
    public void Save();
}