add Api suffix to ApiHawk interfaces, so they will stop colliding with non-api interfaces
This commit is contained in:
parent
d9ef084e2f
commit
f1818e7f7e
|
@ -7,15 +7,15 @@ namespace BizHawk.Client.Common
|
|||
{
|
||||
public Dictionary<Type, IExternalApi> Libraries { get; set; }
|
||||
|
||||
public IEmu Emu => (IEmu) Libraries[typeof(IEmu)];
|
||||
public IEmuApi Emu => (IEmuApi) Libraries[typeof(IEmuApi)];
|
||||
public IGameInfoApi GameInfo => (IGameInfoApi) Libraries[typeof(IGameInfoApi)];
|
||||
public IJoypad Joypad => (IJoypad) Libraries[typeof(IJoypad)];
|
||||
public IMem Mem => (IMem) Libraries[typeof(IMem)];
|
||||
public IMemEvents MemEvents => (IMemEvents) Libraries[typeof(IMemEvents)];
|
||||
public IMemorySaveState MemorySaveState => (IMemorySaveState) Libraries[typeof(IMemorySaveState)];
|
||||
public IInputMovie Movie => (IInputMovie) Libraries[typeof(IInputMovie)];
|
||||
public ISql Sql => (ISql) Libraries[typeof(ISql)];
|
||||
public IUserData UserData => (IUserData) Libraries[typeof(IUserData)];
|
||||
public IJoypadApi Joypad => (IJoypadApi) Libraries[typeof(IJoypadApi)];
|
||||
public IMemApi Mem => (IMemApi) Libraries[typeof(IMemApi)];
|
||||
public IMemEventsApi MemEvents => (IMemEventsApi) Libraries[typeof(IMemEventsApi)];
|
||||
public IMemorySaveStateApi MemorySaveState => (IMemorySaveStateApi) Libraries[typeof(IMemorySaveStateApi)];
|
||||
public IInputMovieApi Movie => (IInputMovieApi) Libraries[typeof(IInputMovieApi)];
|
||||
public ISqlApi Sql => (ISqlApi) Libraries[typeof(ISqlApi)];
|
||||
public IUserDataApi UserData => (IUserDataApi) Libraries[typeof(IUserDataApi)];
|
||||
|
||||
public ApiSubsetContainer(Dictionary<Type, IExternalApi> libs)
|
||||
{
|
||||
|
|
|
@ -9,7 +9,7 @@ using BizHawk.Emulation.Common;
|
|||
|
||||
namespace BizHawk.Client.Common
|
||||
{
|
||||
public sealed class MemApi : IMem
|
||||
public sealed class MemApi : IMemApi
|
||||
{
|
||||
[RequiredService]
|
||||
private IEmulator Emulator { get; set; }
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
namespace BizHawk.Client.Common
|
||||
{
|
||||
public sealed class MemEventsApi : IMemEvents
|
||||
public sealed class MemEventsApi : IMemEventsApi
|
||||
{
|
||||
[RequiredService]
|
||||
private IDebuggable DebuggableCore { get; set; }
|
||||
|
|
|
@ -4,7 +4,7 @@ using BizHawk.Emulation.Common;
|
|||
|
||||
namespace BizHawk.Client.Common
|
||||
{
|
||||
public sealed class MemorySaveStateApi : IMemorySaveState
|
||||
public sealed class MemorySaveStateApi : IMemorySaveStateApi
|
||||
{
|
||||
[RequiredService]
|
||||
private IStatable StatableCore { get; set; }
|
||||
|
|
|
@ -4,7 +4,7 @@ using System.Data.SQLite;
|
|||
|
||||
namespace BizHawk.Client.Common
|
||||
{
|
||||
public sealed class SqlApi : ISql
|
||||
public sealed class SqlApi : ISqlApi
|
||||
{
|
||||
private SQLiteConnection _dbConnection;
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
namespace BizHawk.Client.Common
|
||||
{
|
||||
public interface IComm : IExternalApi
|
||||
public interface ICommApi : IExternalApi
|
||||
{
|
||||
string SocketServerScreenShot();
|
||||
string SocketServerScreenShotResponse();
|
|
@ -4,7 +4,7 @@ using BizHawk.Emulation.Common;
|
|||
|
||||
namespace BizHawk.Client.Common
|
||||
{
|
||||
public interface IEmu : IExternalApi
|
||||
public interface IEmuApi : IExternalApi
|
||||
{
|
||||
Action FrameAdvanceCallback { get; set; }
|
||||
Action YieldCallback { get; set; }
|
|
@ -4,7 +4,7 @@ using System.Drawing.Imaging;
|
|||
|
||||
namespace BizHawk.Client.Common
|
||||
{
|
||||
public interface IGui : IDisposable, IExternalApi
|
||||
public interface IGuiApi : IDisposable, IExternalApi
|
||||
{
|
||||
void ToggleCompositingMode();
|
||||
ImageAttributes GetAttributes();
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
namespace BizHawk.Client.Common
|
||||
{
|
||||
public interface IInput : IExternalApi
|
||||
public interface IInputApi : IExternalApi
|
||||
{
|
||||
Dictionary<string, bool> Get();
|
||||
Dictionary<string, object> GetMouse();
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
namespace BizHawk.Client.Common
|
||||
{
|
||||
public interface IInputMovie : IExternalApi
|
||||
public interface IInputMovieApi : IExternalApi
|
||||
{
|
||||
bool StartsFromSavestate();
|
||||
bool StartsFromSaveram();
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
namespace BizHawk.Client.Common
|
||||
{
|
||||
public interface IJoypad : IExternalApi
|
||||
public interface IJoypadApi : IExternalApi
|
||||
{
|
||||
IDictionary<string, object> Get(int? controller = null);
|
||||
IDictionary<string, object> GetImmediate(int? controller = null);
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
namespace BizHawk.Client.Common
|
||||
{
|
||||
public interface IMem : IExternalApi
|
||||
public interface IMemApi : IExternalApi
|
||||
{
|
||||
void SetBigEndian(bool enabled = true);
|
||||
|
|
@ -1,12 +1,12 @@
|
|||
using BizHawk.Emulation.Common;
|
||||
|
||||
namespace BizHawk.Client.Common
|
||||
{
|
||||
public interface IMemEvents : IExternalApi
|
||||
{
|
||||
void AddReadCallback(MemoryCallbackDelegate cb, uint? address, string domain);
|
||||
void AddWriteCallback(MemoryCallbackDelegate cb, uint? address, string domain);
|
||||
void AddExecCallback(MemoryCallbackDelegate cb, uint? address, string domain);
|
||||
void RemoveMemoryCallback(MemoryCallbackDelegate cb);
|
||||
}
|
||||
}
|
||||
using BizHawk.Emulation.Common;
|
||||
|
||||
namespace BizHawk.Client.Common
|
||||
{
|
||||
public interface IMemEventsApi : IExternalApi
|
||||
{
|
||||
void AddReadCallback(MemoryCallbackDelegate cb, uint? address, string domain);
|
||||
void AddWriteCallback(MemoryCallbackDelegate cb, uint? address, string domain);
|
||||
void AddExecCallback(MemoryCallbackDelegate cb, uint? address, string domain);
|
||||
void RemoveMemoryCallback(MemoryCallbackDelegate cb);
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
namespace BizHawk.Client.Common
|
||||
{
|
||||
public interface IMemorySaveState : IExternalApi
|
||||
public interface IMemorySaveStateApi : IExternalApi
|
||||
{
|
||||
string SaveCoreStateToMemory();
|
||||
void LoadCoreStateFromMemory(string identifier);
|
|
@ -1,6 +1,6 @@
|
|||
namespace BizHawk.Client.Common
|
||||
{
|
||||
public interface ISaveState : IExternalApi
|
||||
public interface ISaveStateApi : IExternalApi
|
||||
{
|
||||
void Load(string path, bool suppressOSD = false);
|
||||
void LoadSlot(int slotNum, bool suppressOSD = false);
|
|
@ -1,6 +1,6 @@
|
|||
namespace BizHawk.Client.Common
|
||||
{
|
||||
public interface ISql : IExternalApi
|
||||
public interface ISqlApi : IExternalApi
|
||||
{
|
||||
string CreateDatabase(string name);
|
||||
string OpenDatabase(string name);
|
|
@ -1,7 +1,7 @@
|
|||
using System;
|
||||
namespace BizHawk.Client.Common
|
||||
{
|
||||
public interface ITool : IExternalApi
|
||||
public interface IToolApi : IExternalApi
|
||||
{
|
||||
Type GetTool(string name);
|
||||
object CreateInstance(string name);
|
|
@ -1,6 +1,6 @@
|
|||
namespace BizHawk.Client.Common
|
||||
{
|
||||
public interface IUserData : IExternalApi
|
||||
public interface IUserDataApi : IExternalApi
|
||||
{
|
||||
void Set(string name, object value);
|
||||
object Get(string key);
|
|
@ -7,7 +7,6 @@ using System.Windows.Forms;
|
|||
using BizHawk.Bizware.BizwareGL;
|
||||
using BizHawk.Client.Common;
|
||||
using BizHawk.Emulation.Common;
|
||||
using IGameInfo = BizHawk.Emulation.Common.IGameInfo;
|
||||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
|
|
|
@ -7,11 +7,11 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
public sealed class ApiContainer : ApiSubsetContainer
|
||||
{
|
||||
public IComm Comm => (IComm) Libraries[typeof(IComm)];
|
||||
public IGui Gui => (IGui) Libraries[typeof(IGui)];
|
||||
public IInput Input => (IInput) Libraries[typeof(IInput)];
|
||||
public ISaveState SaveState => (ISaveState) Libraries[typeof(ISaveState)];
|
||||
public ITool Tool => (ITool) Libraries[typeof(ITool)];
|
||||
public ICommApi Comm => (ICommApi) Libraries[typeof(ICommApi)];
|
||||
public IGuiApi Gui => (IGuiApi) Libraries[typeof(IGuiApi)];
|
||||
public IInputApi Input => (IInputApi) Libraries[typeof(IInputApi)];
|
||||
public ISaveStateApi SaveState => (ISaveStateApi) Libraries[typeof(ISaveStateApi)];
|
||||
public IToolApi Tool => (IToolApi) Libraries[typeof(IToolApi)];
|
||||
|
||||
public ApiContainer(Dictionary<Type, IExternalApi> libs) : base(libs) {}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ using BizHawk.Client.Common;
|
|||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
public sealed class CommApi : IComm
|
||||
public sealed class CommApi : ICommApi
|
||||
{
|
||||
public string SocketServerScreenShot() => GlobalWin.socketServer.SendScreenshot();
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ using BizHawk.Emulation.Cores.WonderSwan;
|
|||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
[Description("A library for interacting with the currently loaded emulator core")]
|
||||
public sealed class EmuApi : IEmu
|
||||
public sealed class EmuApi : IEmuApi
|
||||
{
|
||||
[RequiredService]
|
||||
private IEmulator Emulator { get; set; }
|
||||
|
@ -46,7 +46,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private readonly Action<string> LogCallback;
|
||||
|
||||
/// <summary>Using this property to get a reference to <see cref="GlobalWin.Config">GlobalWin.Config</see> is a terrible, horrible, no good, very bad idea. That's why it's not in the <see cref="IEmu">interface</see>.</summary>
|
||||
/// <summary>Using this property to get a reference to <see cref="GlobalWin.Config">GlobalWin.Config</see> is a terrible, horrible, no good, very bad idea. That's why it's not in the <see cref="IEmuApi">interface</see>.</summary>
|
||||
public Config ForbiddenConfigReference
|
||||
{
|
||||
get
|
||||
|
|
|
@ -12,7 +12,7 @@ using BizHawk.Emulation.Common;
|
|||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
public sealed class GuiApi : IGui
|
||||
public sealed class GuiApi : IGuiApi
|
||||
{
|
||||
[RequiredService]
|
||||
private IEmulator Emulator { get; set; }
|
||||
|
|
|
@ -7,7 +7,7 @@ using BizHawk.Client.Common;
|
|||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
public sealed class InputApi : IInput
|
||||
public sealed class InputApi : IInputApi
|
||||
{
|
||||
private readonly DisplayManager _displayManager;
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ using BizHawk.Emulation.Common;
|
|||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
public sealed class JoypadApi : IJoypad
|
||||
public sealed class JoypadApi : IJoypadApi
|
||||
{
|
||||
public JoypadApi(Action<string> logCallback)
|
||||
{
|
||||
|
|
|
@ -7,7 +7,7 @@ using BizHawk.Emulation.Common;
|
|||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
public sealed class MovieApi : IInputMovie
|
||||
public sealed class MovieApi : IInputMovieApi
|
||||
{
|
||||
public MovieApi(Action<string> logCallback)
|
||||
{
|
||||
|
|
|
@ -6,7 +6,7 @@ using BizHawk.Common;
|
|||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
public sealed class SaveStateApi : ISaveState
|
||||
public sealed class SaveStateApi : ISaveStateApi
|
||||
{
|
||||
private readonly MainForm _mainForm;
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ using BizHawk.Common;
|
|||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
public sealed class ToolApi : ITool
|
||||
public sealed class ToolApi : IToolApi
|
||||
{
|
||||
public Type GetTool(string name)
|
||||
{
|
||||
|
|
|
@ -3,7 +3,7 @@ using BizHawk.Client.Common;
|
|||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
public sealed class UserDataApi : IUserData
|
||||
public sealed class UserDataApi : IUserDataApi
|
||||
{
|
||||
/// <exception cref="InvalidOperationException">type of <paramref name="value"/> cannot be used in userdata</exception>
|
||||
public void Set(string name, object value)
|
||||
|
|
Loading…
Reference in New Issue