using Sandbox.ModAPI.Ingame; namespace XFEExtension.SpaceEngineers.ScriptingHelper; /// /// 定义了一个接口,提供了在游戏内脚本执行时调用的主入口点和保存状态的方法。
/// Defines an interface providing a main entry point for execution when the in-game script runs and a method for saving state. ///
public interface IProgramBase { /// /// 当游戏内脚本执行时调用。根据传入的参数和更新源执行相应的逻辑。
/// Executes the main entry point for the program, processing the specified argument based on the provided update /// source. ///
/// 需要处理的输入字符串。不能为空;表示要处理的命令或数据。
The input string to be processed. Cannot be null; represents the command or data to handle. /// 触发执行的更新源。决定如何解释和处理参数。
The source of the update triggering the execution. Determines how the argument is interpreted and processed. public void Main(string argument, UpdateType updateSource); /// /// 当游戏内脚本需要保存其状态时调用。可以在此方法中实现任何必要的逻辑来持久化数据,以便在脚本重新加载时恢复状态。
/// Called when the program needs to save its state. ///
public void Save(); }