using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Torch.API.Managers;
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;
///
/// Configuration for the current instance.
///
ITorchConfig Config { get; }
///
IMultiplayerManager Multiplayer { get; }
///
IPluginManager Plugins { get; }
///
/// 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();
///
/// Get an that is part of the Torch instance.
///
/// Manager type
T GetManager() where T : class, IManager;
}
///
/// 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
{
}
}