My New Year's resolution is to stop making commits like these

This commit is contained in:
John Gross
2017-01-01 16:37:30 -08:00
parent 81037b502a
commit 6e0922b805
33 changed files with 780 additions and 249 deletions

14
Torch.API/ILogger.cs Normal file
View File

@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Torch.API
{
public interface ILogger
{
void Write(string message);
void WriteException(Exception e);
}
}

View File

@@ -1,21 +1,12 @@
using System;
using System.Collections.Generic;
using VRage.Collections;
using VRage.Plugins;
namespace Torch.API
{
public interface IPluginManager
public interface IPluginManager : IEnumerable<ITorchPlugin>
{
ListReader<IPlugin> Plugins { get; }
string[] GetPluginFolders();
string GetPluginName(Type pluginType);
void LoadAllPlugins();
void LoadPlugin(IPlugin plugin);
void LoadPluginFolder(string folderName);
void ReloadAll();
void ReloadPlugin(IPlugin plugin, bool forceNonPiston = false);
bool UnblockDll(string fileName);
void UnloadPlugin(IPlugin plugin);
}
}

View File

@@ -11,8 +11,10 @@ namespace Torch.API
event Action SessionLoaded;
IMultiplayer Multiplayer { get; }
IPluginManager Plugins { get; }
void DoGameAction(Action action);
Task DoGameActionAsync(Action action);
ILogger Log { get; set; }
void Invoke(Action action);
void InvokeBlocking(Action action);
Task InvokeAsync(Action action);
string[] RunArgs { get; set; }
void Start();
void Stop();

View File

@@ -4,13 +4,18 @@ using System.Linq;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading.Tasks;
using VRage.Plugins;
namespace Torch.API
{
public interface ITorchPlugin : IPlugin
public interface ITorchPlugin
{
void Init(ITorchBase torch);
void Reload();
Guid Id { get; }
Version Version { get; }
string Name { get; }
bool Enabled { get; set; }
void Init(ITorchBase torchBase);
void Update();
void Unload();
}
}

View File

@@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PistonAPI
namespace Torch.API
{
public class PluginAttribute : Attribute
{

View File

@@ -53,6 +53,7 @@
<ItemGroup>
<Compile Include="ConnectionState.cs" />
<Compile Include="IChatItem.cs" />
<Compile Include="ILogger.cs" />
<Compile Include="IMultiplayer.cs" />
<Compile Include="IPlayer.cs" />
<Compile Include="IPluginManager.cs" />