using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Torch.API.Managers; using Torch.API.Session; using VRage.Game.ModAPI; namespace Torch.API { /// /// API for Torch functions shared between client and server. /// public interface ITorchBase { /// /// Fired when the session begins loading. /// event Action SessionLoading; /// /// Fired when the session finishes loading. /// event Action SessionLoaded; /// /// Fires when the session begins unloading. /// event Action SessionUnloading; /// /// Fired when the session finishes unloading. /// event Action SessionUnloaded; /// /// Gets the currently running session instance, or null if none exists. /// ITorchSession CurrentSession { get; } /// /// Configuration for the current instance. /// ITorchConfig Config { get; } /// [Obsolete] IPluginManager Plugins { get; } /// IDependencyManager Managers { get; } [Obsolete("Prefer using Managers.GetManager for global managers")] T GetManager() where T : class, IManager; [Obsolete("Prefer using Managers.AddManager for global managers")] bool AddManager(T manager) where T : class, IManager; /// /// The binary version of the current instance. /// Version TorchVersion { get; } /// /// Invoke an action on the game thread. /// void Invoke(Action action); /// /// Invoke an action on the game thread and block until it has completed. /// If this is called on the game thread the action will execute immediately. /// void InvokeBlocking(Action action); /// /// Invoke an action on the game thread asynchronously. /// Task InvokeAsync(Action action); /// /// Start the Torch instance. /// void Start(); /// /// Stop the Torch instance. /// void Stop(); /// /// Restart the Torch instance. /// void Restart(); /// /// Initializes a save of the game. /// /// Id of the player who initiated the save. Task Save(long callerId); /// /// Initialize the Torch instance. /// void Init(); /// /// The current state of the game this instance of torch is controlling. /// TorchGameState GameState { get; } /// /// Event raised when changes. /// event TorchGameStateChangedDel GameStateChanged; } /// /// API for the Torch server. /// public interface ITorchServer : ITorchBase { /// /// Path of the dedicated instance folder. /// string InstancePath { get; } } /// /// API for the Torch client. /// public interface ITorchClient : ITorchBase { } }