Follow attribute class best practices, cleanup docs on attributes

This commit is contained in:
YoshiRulz 2020-02-19 01:10:24 +10:00
parent 0ff2539da7
commit 3afcf416e8
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
50 changed files with 127 additions and 130 deletions

View File

@ -122,23 +122,15 @@ namespace BizHawk.BizInvoke
} }
} }
/// <summary> /// <summary>Indicates that a method is to be exported by BizExvoker.</summary>
/// mark an instance method to be exported by BizExvoker
/// </summary>
[AttributeUsage(AttributeTargets.Method)] [AttributeUsage(AttributeTargets.Method)]
public class BizExportAttribute : Attribute public sealed class BizExportAttribute : Attribute
{ {
public CallingConvention CallingConvention { get; } public CallingConvention CallingConvention { get; }
/// <summary> /// <remarks>The annotated method's name is used iff <see langword="null"/>.</remarks>
/// Gets or sets the name of entry point; if not given, the method's name is used
/// </summary>
public string EntryPoint { get; set; } public string EntryPoint { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="BizImportAttribute"/> class.
/// </summary>
/// <param name="c">unmanaged calling convention</param>
public BizExportAttribute(CallingConvention c) public BizExportAttribute(CallingConvention c)
{ {
CallingConvention = c; CallingConvention = c;

View File

@ -537,28 +537,18 @@ namespace BizHawk.BizInvoke
} }
} }
/// <summary> /// <summary>Indicates that an abstract method is to be proxied by BizInvoker.</summary>
/// mark an abstract method to be proxied by BizInvoker
/// </summary>
[AttributeUsage(AttributeTargets.Method)] [AttributeUsage(AttributeTargets.Method)]
public class BizImportAttribute : Attribute public sealed class BizImportAttribute : Attribute
{ {
public CallingConvention CallingConvention { get; } public CallingConvention CallingConvention { get; }
/// <summary> /// <remarks>The annotated method's name is used iff <see langword="null"/>.</remarks>
/// Gets or sets the name of entry point; if not given, the method's name is used
/// </summary>
public string EntryPoint { get; set; } public string EntryPoint { get; set; }
/// <summary> /// <summary><see langword="true"/> iff a compatibility interop should be used, which is slower but supports more argument types.</summary>
/// Gets or sets a value indicating whether or not to use a slower interop that supports more argument types
/// </summary>
public bool Compatibility { get; set; } public bool Compatibility { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="BizImportAttribute"/> class.
/// </summary>
/// <param name="c">unmanaged calling convention</param>
public BizImportAttribute(CallingConvention c) public BizImportAttribute(CallingConvention c)
{ {
CallingConvention = c; CallingConvention = c;

View File

@ -68,12 +68,12 @@ namespace BizHawk.Client.ApiHawk
} }
[AttributeUsage(AttributeTargets.Property)] [AttributeUsage(AttributeTargets.Property)]
public class RequiredApiAttribute : Attribute public sealed class RequiredApiAttribute : Attribute
{ {
} }
[AttributeUsage(AttributeTargets.Property)] [AttributeUsage(AttributeTargets.Property)]
public class OptionalApiAttribute : Attribute public sealed class OptionalApiAttribute : Attribute
{ {
} }
} }

View File

@ -96,13 +96,12 @@ namespace BizHawk.Client.Common
[AttributeUsage(AttributeTargets.Class)] [AttributeUsage(AttributeTargets.Class)]
public sealed class ExternalToolAttribute : Attribute public sealed class ExternalToolAttribute : Attribute
{ {
public readonly string Description; public string Description { get; set; }
public readonly string Name; public readonly string Name;
public ExternalToolAttribute(string name, string description = null) public ExternalToolAttribute(string name)
{ {
Description = description;
Name = string.IsNullOrWhiteSpace(name) ? Guid.NewGuid().ToString() : name; Name = string.IsNullOrWhiteSpace(name) ? Guid.NewGuid().ToString() : name;
} }

View File

@ -69,7 +69,7 @@ namespace BizHawk.Client.Common
public static BinaryStateLump BranchUserText { get; private set; } public static BinaryStateLump BranchUserText { get; private set; }
[AttributeUsage(AttributeTargets.Property)] [AttributeUsage(AttributeTargets.Property)]
private class NameAttribute : Attribute private sealed class NameAttribute : Attribute
{ {
public string Name { get; } public string Name { get; }
public string Ext { get; } public string Ext { get; }

View File

@ -2,11 +2,9 @@
namespace BizHawk.Client.Common namespace BizHawk.Client.Common
{ {
/// <summary> /// <summary>Indicates that a property is to be saved to config for persistence.</summary>
/// Define if the property has to be persisted in config
/// </summary>
[AttributeUsage(AttributeTargets.Property)] [AttributeUsage(AttributeTargets.Property)]
public class ConfigPersistAttribute : Attribute public sealed class ConfigPersistAttribute : Attribute
{ {
} }
} }

View File

@ -2,11 +2,10 @@
namespace BizHawk.Client.Common namespace BizHawk.Client.Common
{ {
/// <summary> /// <summary>Indicates which method of an <see cref="IToolFormAutoConfig"/> is to be called when the generated <c>Restore Defaults</c> menu item is clicked.</summary>
/// Defines a method to be called when a tool dialog's Restore Defaults method is called /// <remarks>If not present on any instance method, the menu item will do nothing. If present on multiple, the first will be called.</remarks>
/// </summary>
[AttributeUsage(AttributeTargets.Method)] [AttributeUsage(AttributeTargets.Method)]
public class RestoreDefaultsAttribute : Attribute public sealed class RestoreDefaultsAttribute : Attribute
{ {
} }
} }

View File

@ -3,7 +3,7 @@
namespace BizHawk.Client.Common namespace BizHawk.Client.Common
{ {
[AttributeUsage(AttributeTargets.Method)] [AttributeUsage(AttributeTargets.Method)]
public class LuaMethodAttribute : Attribute public sealed class LuaMethodAttribute : Attribute
{ {
public LuaMethodAttribute(string name, string description) public LuaMethodAttribute(string name, string description)
{ {
@ -16,7 +16,7 @@ namespace BizHawk.Client.Common
} }
[AttributeUsage(AttributeTargets.Method)] [AttributeUsage(AttributeTargets.Method)]
public class LuaMethodExampleAttribute : Attribute public sealed class LuaMethodExampleAttribute : Attribute
{ {
public LuaMethodExampleAttribute(string example) public LuaMethodExampleAttribute(string example)
{ {
@ -27,7 +27,7 @@ namespace BizHawk.Client.Common
} }
[AttributeUsage(AttributeTargets.Class)] [AttributeUsage(AttributeTargets.Class)]
public class LuaLibraryAttribute : Attribute public sealed class LuaLibraryAttribute : Attribute
{ {
public LuaLibraryAttribute(bool released) public LuaLibraryAttribute(bool released)
{ {

View File

@ -101,7 +101,7 @@ namespace BizHawk.Client.Common
} }
[AttributeUsage(AttributeTargets.Class)] [AttributeUsage(AttributeTargets.Class)]
public class ImporterForAttribute : Attribute public sealed class ImporterForAttribute : Attribute
{ {
public ImporterForAttribute(string emulator, string extension) public ImporterForAttribute(string emulator, string extension)
{ {

View File

@ -99,7 +99,7 @@ namespace BizHawk.Client.EmuHawk
} }
[AttributeUsage(AttributeTargets.Class)] [AttributeUsage(AttributeTargets.Class)]
public class VideoWriterAttribute : Attribute public sealed class VideoWriterAttribute : Attribute
{ {
public string ShortName { get; } public string ShortName { get; }
public string Name { get; } public string Name { get; }
@ -114,7 +114,7 @@ namespace BizHawk.Client.EmuHawk
} }
[AttributeUsage(AttributeTargets.Class)] [AttributeUsage(AttributeTargets.Class)]
public class VideoWriterIgnoreAttribute : Attribute public sealed class VideoWriterIgnoreAttribute : Attribute
{ {
} }

View File

@ -5,15 +5,17 @@ using System.Linq;
namespace BizHawk.Client.EmuHawk namespace BizHawk.Client.EmuHawk
{ {
[AttributeUsage(AttributeTargets.Class)] [AttributeUsage(AttributeTargets.Class)]
public class ToolAttribute : Attribute public sealed class ToolAttribute : Attribute
{ {
public ToolAttribute(bool released, string[] supportedSystems, string[] unsupportedCores = null) public ToolAttribute(bool released, string[] supportedSystems, string[] unsupportedCores)
{ {
Released = released; Released = released;
SupportedSystems = supportedSystems ?? Enumerable.Empty<string>(); SupportedSystems = supportedSystems ?? Enumerable.Empty<string>();
UnsupportedCores = unsupportedCores ?? Enumerable.Empty<string>(); UnsupportedCores = unsupportedCores ?? Enumerable.Empty<string>();
} }
public ToolAttribute(bool released, string[] supportedSystems) : this(released, supportedSystems, null) {}
public bool Released { get; } public bool Released { get; }
public IEnumerable<string> SupportedSystems { get; } public IEnumerable<string> SupportedSystems { get; }

View File

@ -3,11 +3,8 @@
namespace BizHawk.Client.EmuHawk namespace BizHawk.Client.EmuHawk
{ {
[AttributeUsage(AttributeTargets.Class)] [AttributeUsage(AttributeTargets.Class)]
public class SchemaAttribute : Attribute public sealed class SchemaAttribute : Attribute
{ {
/// <summary>
/// Gets the system id associated with this schema
/// </summary>
public string SystemId { get; } public string SystemId { get; }
public SchemaAttribute(string systemId) public SchemaAttribute(string systemId)

View File

@ -7,11 +7,9 @@ using System.Reflection;
namespace BizHawk.Common namespace BizHawk.Common
{ {
/// <summary> /// <summary>Annotated fields will not be used by <see cref="DeepEquality"/> for comparison.</summary>
/// causes DeepEquality to ignore this field when determining equality
/// </summary>
[AttributeUsage(AttributeTargets.Field)] [AttributeUsage(AttributeTargets.Field)]
public class DeepEqualsIgnoreAttribute : Attribute public sealed class DeepEqualsIgnoreAttribute : Attribute
{ {
} }

View File

@ -1,8 +1,21 @@
namespace BizHawk.Emulation.Common namespace BizHawk.Emulation.Common
{ {
[Core("NullHawk", "", false, true)] [Core("NullHawk", "", false, true)]
[ServiceNotApplicable(typeof(IStatable), typeof(ISaveRam), typeof(IDriveLight), typeof(ICodeDataLogger), typeof(IMemoryDomains), typeof(ISettable<,>), [ServiceNotApplicable(new[] {
typeof(IDebuggable), typeof(IDisassemblable), typeof(IInputPollable), typeof(IRegionable), typeof(ITraceable), typeof(IBoardInfo), typeof(ISoundProvider))] typeof(IBoardInfo),
typeof(ICodeDataLogger),
typeof(IDebuggable),
typeof(IDisassemblable),
typeof(IDriveLight),
typeof(IInputPollable),
typeof(IMemoryDomains),
typeof(IRegionable),
typeof(ISaveRam),
typeof(ISettable<,>),
typeof(ISoundProvider),
typeof(IStatable),
typeof(ITraceable)
})]
public class NullEmulator : IEmulator, IVideoProvider public class NullEmulator : IEmulator, IVideoProvider
{ {
private readonly int[] _frameBuffer = new int[NullVideo.DefaultWidth * NullVideo.DefaultHeight]; private readonly int[] _frameBuffer = new int[NullVideo.DefaultWidth * NullVideo.DefaultHeight];

View File

@ -3,26 +3,22 @@
namespace BizHawk.Emulation.Common namespace BizHawk.Emulation.Common
{ {
[AttributeUsage(AttributeTargets.Class)] [AttributeUsage(AttributeTargets.Class)]
public class CoreAttribute : Attribute public sealed class CoreAttribute : Attribute
{ {
public CoreAttribute( public CoreAttribute(string name, string author, bool isPorted, bool isReleased, string portedVersion, string portedUrl, bool singleInstance)
string name,
string author,
bool isPorted = false,
bool isReleased = false,
string portedVersion = "",
string portedUrl = "",
bool singleInstance = false)
{ {
CoreName = name; CoreName = name;
Author = author; Author = author;
Ported = isPorted; Ported = isPorted;
Released = isReleased; Released = isReleased;
PortedVersion = portedVersion; PortedVersion = portedVersion ?? string.Empty;
PortedUrl = portedUrl; PortedUrl = portedUrl ?? string.Empty;
SingleInstance = singleInstance; SingleInstance = singleInstance;
} }
public CoreAttribute(string name, string author, bool isPorted, bool isReleased)
: this(name, author, isPorted, isReleased, null, null, false) {}
public string CoreName { get; } public string CoreName { get; }
public string Author { get; } public string Author { get; }
public bool Ported { get; } public bool Ported { get; }

View File

@ -4,26 +4,27 @@ using System.Linq;
namespace BizHawk.Emulation.Common namespace BizHawk.Emulation.Common
{ {
/// <summary> /// <summary>Indicates that a method (or property getter/setter) inherited from a <see cref="IEmulatorService"/> has yet to be implemented.</summary>
/// Should be added to any field of an IEmulatorService that is not implemented. /// <remarks>
/// By Convention it should also throw a NotImplementedException /// By convention, calling a method with this attribute should throw a <see cref="NotImplementedException"/>.
/// Any feature that does not have this attribute is assumed to be implemented /// If this attribute is not present on an implementation, it is assumed that the method is implemented and working.
/// </summary> /// </remarks>
public class FeatureNotImplementedAttribute : Attribute [AttributeUsage(AttributeTargets.Method | AttributeTargets.Property)]
public sealed class FeatureNotImplementedAttribute : Attribute
{ {
} }
/// <summary> /// <summary>Indicates that a class intentionally does not inherit from the specified <see cref="IEmulatorService">IEmulatorServices</see>, and will never do so.</summary>
/// Should be added to any implementation of IEmulator to document any /// <remarks>
/// IEmulatorService (that is not an ISpecializedEmulatorService) that /// <see cref="ISpecializedEmulatorService">ISpecializedEmulatorServices</see> that a core doesn't implement should not be listed, as the semantic of only being applicable to some cores is already clear.<br/>
/// by design, will not be implemented by the core /// Any <see cref="IEmulatorService"/> which isn't specified and is also not implemented is assumed to be a work-in-progress.
/// Any service that is unimplemented and not marked with this attribute is /// These should be implemented as soon as possible, simply throwing a <see cref="NotImplementedException"/> on call, and should be annotated with <see cref="FeatureNotImplementedAttribute"/>.
/// assumed to be a "TODO" that needs to be done but hasn't been done yet /// </remarks>
/// </summary>
[AttributeUsage(AttributeTargets.Class)] [AttributeUsage(AttributeTargets.Class)]
public class ServiceNotApplicableAttribute : Attribute public sealed class ServiceNotApplicableAttribute : Attribute
{ {
public ServiceNotApplicableAttribute(params Type[] types) /// <remarks>TODO neither array nor <see cref="IEnumerable{T}"/> is the correct collection to be using here, try <see cref="IReadOnlyList{T}"/>/<see cref="IReadOnlyCollection{T}"/> instead</remarks>
public ServiceNotApplicableAttribute(Type[] types)
{ {
NotApplicableTypes = types?.AsEnumerable() ?? Enumerable.Empty<Type>(); NotApplicableTypes = types?.AsEnumerable() ?? Enumerable.Empty<Type>();
} }

View File

@ -68,12 +68,12 @@ namespace BizHawk.Emulation.Common
} }
[AttributeUsage(AttributeTargets.Property)] [AttributeUsage(AttributeTargets.Property)]
public class RequiredServiceAttribute : Attribute public sealed class RequiredServiceAttribute : Attribute
{ {
} }
[AttributeUsage(AttributeTargets.Property)] [AttributeUsage(AttributeTargets.Property)]
public class OptionalServiceAttribute : Attribute public sealed class OptionalServiceAttribute : Attribute
{ {
} }
} }

View File

@ -15,6 +15,7 @@ namespace BizHawk.Emulation.Cores.Arcades.MAME
name: "MAME", name: "MAME",
author: "MAMEDev", author: "MAMEDev",
isPorted: true, isPorted: true,
isReleased: false,
portedVersion: "0.217", portedVersion: "0.217",
portedUrl: "https://github.com/mamedev/mame.git", portedUrl: "https://github.com/mamedev/mame.git",
singleInstance: false)] singleInstance: false)]

View File

@ -10,7 +10,7 @@ namespace BizHawk.Emulation.Cores.Calculators
"zeromus", "zeromus",
isPorted: false, isPorted: false,
isReleased: true)] isReleased: true)]
[ServiceNotApplicable(typeof(ISoundProvider), typeof(ISaveRam), typeof(IRegionable), typeof(IDriveLight), typeof(IBoardInfo))] [ServiceNotApplicable(new[] { typeof(IBoardInfo), typeof(IDriveLight), typeof(IRegionable), typeof(ISaveRam), typeof(ISoundProvider) })]
public partial class TI83 : IEmulator, IVideoProvider, IDebuggable, IInputPollable, ISettable<TI83.TI83Settings, object> public partial class TI83 : IEmulator, IVideoProvider, IDebuggable, IInputPollable, ISettable<TI83.TI83Settings, object>
{ {
[CoreConstructor("TI83")] [CoreConstructor("TI83")]

View File

@ -11,7 +11,7 @@ namespace BizHawk.Emulation.Cores.Computers.AppleII
"fool", "fool",
isPorted: true, isPorted: true,
isReleased: true)] isReleased: true)]
[ServiceNotApplicable(typeof(ISaveRam), typeof(IRegionable), typeof(IBoardInfo))] [ServiceNotApplicable(new[] { typeof(IBoardInfo), typeof(IRegionable), typeof(ISaveRam) })]
public partial class AppleII : IEmulator, ISoundProvider, IVideoProvider, IStatable, IDriveLight public partial class AppleII : IEmulator, ISoundProvider, IVideoProvider, IStatable, IDriveLight
{ {
static AppleII() static AppleII()

View File

@ -9,7 +9,7 @@ namespace BizHawk.Emulation.Cores.Computers.MSX
"", "",
isPorted: false, isPorted: false,
isReleased: false)] isReleased: false)]
[ServiceNotApplicable(typeof(IDriveLight))] [ServiceNotApplicable(new[] { typeof(IDriveLight) })]
public partial class MSX : IEmulator, IVideoProvider, ISoundProvider, ISaveRam, IInputPollable, IRegionable, ISettable<MSX.MSXSettings, MSX.MSXSyncSettings> public partial class MSX : IEmulator, IVideoProvider, ISoundProvider, ISaveRam, IInputPollable, IRegionable, ISettable<MSX.MSXSettings, MSX.MSXSyncSettings>
{ {
[CoreConstructor("MSX")] [CoreConstructor("MSX")]

View File

@ -11,7 +11,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600
"Micro500, Alyosha, adelikat, natt", "Micro500, Alyosha, adelikat, natt",
isPorted: false, isPorted: false,
isReleased: true)] isReleased: true)]
[ServiceNotApplicable(typeof(ISaveRam), typeof(IDriveLight))] [ServiceNotApplicable(new[] { typeof(IDriveLight), typeof(ISaveRam) })]
public partial class Atari2600 : IEmulator, IDebuggable, IInputPollable, IBoardInfo, public partial class Atari2600 : IEmulator, IDebuggable, IInputPollable, IBoardInfo,
IRegionable, ICreateGameDBEntries, ISettable<Atari2600.A2600Settings, Atari2600.A2600SyncSettings> IRegionable, ICreateGameDBEntries, ISettable<Atari2600.A2600Settings, Atari2600.A2600SyncSettings>
{ {

View File

@ -12,7 +12,7 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk
"", "",
isPorted: false, isPorted: false,
isReleased: true)] isReleased: true)]
[ServiceNotApplicable(typeof(ISettable<,>), typeof(IDriveLight))] [ServiceNotApplicable(new[] { typeof(IDriveLight), typeof(ISettable<,>) })]
public partial class A7800Hawk : IEmulator, ISaveRam, IDebuggable, IInputPollable, public partial class A7800Hawk : IEmulator, ISaveRam, IDebuggable, IInputPollable,
IRegionable, IBoardInfo, ISettable<A7800Hawk.A7800Settings, A7800Hawk.A7800SyncSettings> IRegionable, IBoardInfo, ISettable<A7800Hawk.A7800Settings, A7800Hawk.A7800SyncSettings>
{ {

View File

@ -6,8 +6,8 @@ using BizHawk.Emulation.Common;
namespace BizHawk.Emulation.Cores.Atari.Lynx namespace BizHawk.Emulation.Cores.Atari.Lynx
{ {
[Core("Handy", "K. Wilkins, Mednafen Team", true, true, "mednafen 0-9-34-1", "http://mednafen.sourceforge.net/")] [Core("Handy", "K. Wilkins, Mednafen Team", true, true, "mednafen 0-9-34-1", "http://mednafen.sourceforge.net/", false)]
[ServiceNotApplicable(typeof(ISettable<,>), typeof(IDriveLight), typeof(IRegionable))] [ServiceNotApplicable(new[] { typeof(IDriveLight), typeof(IRegionable), typeof(ISettable<,>) })]
public partial class Lynx : IEmulator, IVideoProvider, ISoundProvider, ISaveRam, IStatable, IInputPollable public partial class Lynx : IEmulator, IVideoProvider, ISoundProvider, ISaveRam, IStatable, IInputPollable
{ {
[CoreConstructor("Lynx")] [CoreConstructor("Lynx")]

View File

@ -9,7 +9,7 @@ namespace BizHawk.Emulation.Cores.ColecoVision
"Vecna", "Vecna",
isPorted: false, isPorted: false,
isReleased: true)] isReleased: true)]
[ServiceNotApplicable(typeof(ISaveRam), typeof(IDriveLight))] [ServiceNotApplicable(new[] { typeof(IDriveLight), typeof(ISaveRam) })]
public sealed partial class ColecoVision : IEmulator, IDebuggable, IInputPollable, ISettable<ColecoVision.ColecoSettings, ColecoVision.ColecoSyncSettings> public sealed partial class ColecoVision : IEmulator, IDebuggable, IInputPollable, ISettable<ColecoVision.ColecoSettings, ColecoVision.ColecoSyncSettings>
{ {
[CoreConstructor("Coleco")] [CoreConstructor("Coleco")]

View File

@ -8,7 +8,7 @@ namespace BizHawk.Emulation.Cores.Consoles.ChannelF
"Asnivor", "Asnivor",
isPorted: false, isPorted: false,
isReleased: false)] isReleased: false)]
[ServiceNotApplicable(typeof(IDriveLight))] [ServiceNotApplicable(new[] { typeof(IDriveLight) })]
public partial class ChannelF public partial class ChannelF
{ {
public ChannelF(CoreComm comm, GameInfo game, byte[] rom, object settings, object syncSettings) public ChannelF(CoreComm comm, GameInfo game, byte[] rom, object settings, object syncSettings)

View File

@ -11,7 +11,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Vectrex
"", "",
isPorted: false, isPorted: false,
isReleased: true)] isReleased: true)]
[ServiceNotApplicable(typeof(IDriveLight))] [ServiceNotApplicable(new[] { typeof(IDriveLight) })]
public partial class VectrexHawk : IEmulator, ISaveRam, IDebuggable, IInputPollable, IRegionable, public partial class VectrexHawk : IEmulator, ISaveRam, IDebuggable, IInputPollable, IRegionable,
ISettable<VectrexHawk.VectrexSettings, VectrexHawk.VectrexSyncSettings> ISettable<VectrexHawk.VectrexSettings, VectrexHawk.VectrexSyncSettings>
{ {

View File

@ -10,7 +10,7 @@ namespace BizHawk.Emulation.Cores.Intellivision
"BrandonE, Alyosha", "BrandonE, Alyosha",
isPorted: false, isPorted: false,
isReleased: true)] isReleased: true)]
[ServiceNotApplicable(typeof(ISaveRam), typeof(IDriveLight), typeof(IRegionable))] [ServiceNotApplicable(new[] { typeof(IDriveLight), typeof(IRegionable), typeof(ISaveRam) })]
public sealed partial class Intellivision : IEmulator, IInputPollable, IDisassemblable, public sealed partial class Intellivision : IEmulator, IInputPollable, IDisassemblable,
IBoardInfo, IDebuggable, ISettable<Intellivision.IntvSettings, Intellivision.IntvSyncSettings> IBoardInfo, IDebuggable, ISettable<Intellivision.IntvSettings, Intellivision.IntvSyncSettings>
{ {

View File

@ -11,7 +11,7 @@ namespace BizHawk.Emulation.Cores.Consoles.O2Hawk
"", "",
isPorted: false, isPorted: false,
isReleased: false)] isReleased: false)]
[ServiceNotApplicable(typeof(IDriveLight))] [ServiceNotApplicable(new[] { typeof(IDriveLight) })]
public partial class O2Hawk : IEmulator, ISaveRam, IDebuggable, IInputPollable, IRegionable, ISettable<O2Hawk.O2Settings, O2Hawk.O2SyncSettings> public partial class O2Hawk : IEmulator, ISaveRam, IDebuggable, IInputPollable, IRegionable, ISettable<O2Hawk.O2Settings, O2Hawk.O2SyncSettings>
{ {
// memory domains // memory domains

View File

@ -5,7 +5,7 @@ using BizHawk.Emulation.Common;
namespace BizHawk.Emulation.Cores.Nintendo.GBA namespace BizHawk.Emulation.Cores.Nintendo.GBA
{ {
[Core("mGBA", "endrift", true, true, "0.8", "https://mgba.io/", false)] [Core("mGBA", "endrift", true, true, "0.8", "https://mgba.io/", false)]
[ServiceNotApplicable(typeof(IDriveLight), typeof(IRegionable))] [ServiceNotApplicable(new[] { typeof(IDriveLight), typeof(IRegionable) })]
public partial class MGBAHawk : IEmulator, IVideoProvider, ISoundProvider, IGBAGPUViewable, public partial class MGBAHawk : IEmulator, IVideoProvider, ISoundProvider, IGBAGPUViewable,
ISaveRam, IStatable, IInputPollable, ISettable<MGBAHawk.Settings, MGBAHawk.SyncSettings>, ISaveRam, IStatable, IInputPollable, ISettable<MGBAHawk.Settings, MGBAHawk.SyncSettings>,
IDebuggable IDebuggable

View File

@ -7,8 +7,8 @@ using BizHawk.Emulation.Cores.Components.ARM;
namespace BizHawk.Emulation.Cores.Nintendo.GBA namespace BizHawk.Emulation.Cores.Nintendo.GBA
{ {
[Core("VBA-Next", "many authors", true, true, "cd508312a29ed8c29dacac1b11c2dce56c338a54", "https://github.com/libretro/vba-next")] [Core("VBA-Next", "many authors", true, true, "cd508312a29ed8c29dacac1b11c2dce56c338a54", "https://github.com/libretro/vba-next", false)]
[ServiceNotApplicable(typeof(IDriveLight), typeof(IRegionable))] [ServiceNotApplicable(new[] { typeof(IDriveLight), typeof(IRegionable) })]
public partial class VBANext : IEmulator, IVideoProvider, ISoundProvider, IInputPollable, public partial class VBANext : IEmulator, IVideoProvider, ISoundProvider, IInputPollable,
IGBAGPUViewable, ISaveRam, IStatable, IDebuggable, ISettable<object, VBANext.SyncSettings> IGBAGPUViewable, ISaveRam, IStatable, IDebuggable, ISettable<object, VBANext.SyncSettings>
{ {

View File

@ -14,7 +14,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
"", "",
isPorted: false, isPorted: false,
isReleased: true)] isReleased: true)]
[ServiceNotApplicable(typeof(IDriveLight))] [ServiceNotApplicable(new[] { typeof(IDriveLight) })]
public partial class GBHawk : IEmulator, ISaveRam, IDebuggable, IInputPollable, IRegionable, IGameboyCommon, public partial class GBHawk : IEmulator, ISaveRam, IDebuggable, IInputPollable, IRegionable, IGameboyCommon,
ISettable<GBHawk.GBSettings, GBHawk.GBSyncSettings> ISettable<GBHawk.GBSettings, GBHawk.GBSyncSettings>
{ {
@ -84,7 +84,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
private static byte[] GBA_override = { 0xFF, 0x00, 0xCD, 0x03, 0x35, 0xAA, 0x31, 0x90, 0x94, 0x00, 0x00, 0x00, 0x00 }; private static byte[] GBA_override = { 0xFF, 0x00, 0xCD, 0x03, 0x35, 0xAA, 0x31, 0x90, 0x94, 0x00, 0x00, 0x00, 0x00 };
[CoreConstructor("GB", "GBC")] [CoreConstructor(new[] { "GB", "GBC" })]
public GBHawk(CoreComm comm, GameInfo game, byte[] rom, /*string gameDbFn,*/ object settings, object syncSettings) public GBHawk(CoreComm comm, GameInfo game, byte[] rom, /*string gameDbFn,*/ object settings, object syncSettings)
{ {
var ser = new BasicServiceProvider(this); var ser = new BasicServiceProvider(this);

View File

@ -7,7 +7,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawkLink
"", "",
isPorted: false, isPorted: false,
isReleased: true)] isReleased: true)]
[ServiceNotApplicable(typeof(IDriveLight))] [ServiceNotApplicable(new[] { typeof(IDriveLight) })]
public partial class GBHawkLink : IEmulator, ISaveRam, IDebuggable, IStatable, IInputPollable, IRegionable, ILinkable, public partial class GBHawkLink : IEmulator, ISaveRam, IDebuggable, IStatable, IInputPollable, IRegionable, ILinkable,
ISettable<GBHawkLink.GBLinkSettings, GBHawkLink.GBLinkSyncSettings> ISettable<GBHawkLink.GBLinkSettings, GBHawkLink.GBLinkSyncSettings>
{ {

View File

@ -7,7 +7,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawkLink3x
"", "",
isPorted: false, isPorted: false,
isReleased: true)] isReleased: true)]
[ServiceNotApplicable(typeof(IDriveLight))] [ServiceNotApplicable(new[] { typeof(IDriveLight) })]
public partial class GBHawkLink3x : IEmulator, ISaveRam, IDebuggable, IStatable, IInputPollable, IRegionable, public partial class GBHawkLink3x : IEmulator, ISaveRam, IDebuggable, IStatable, IInputPollable, IRegionable,
ISettable<GBHawkLink3x.GBLink3xSettings, GBHawkLink3x.GBLink3xSyncSettings> ISettable<GBHawkLink3x.GBLink3xSettings, GBHawkLink3x.GBLink3xSyncSettings>
{ {

View File

@ -7,7 +7,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawkLink4x
"", "",
isPorted: false, isPorted: false,
isReleased: false)] isReleased: false)]
[ServiceNotApplicable(typeof(IDriveLight))] [ServiceNotApplicable(new[] { typeof(IDriveLight) })]
public partial class GBHawkLink4x : IEmulator, ISaveRam, IDebuggable, IStatable, IInputPollable, IRegionable, public partial class GBHawkLink4x : IEmulator, ISaveRam, IDebuggable, IStatable, IInputPollable, IRegionable,
ISettable<GBHawkLink4x.GBLink4xSettings, GBHawkLink4x.GBLink4xSyncSettings> ISettable<GBHawkLink4x.GBLink4xSettings, GBHawkLink4x.GBLink4xSyncSettings>
{ {

View File

@ -15,13 +15,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
isPorted: true, isPorted: true,
isReleased: true, isReleased: true,
portedVersion: "SVN 344", portedVersion: "SVN 344",
portedUrl: "http://gambatte.sourceforge.net/")] portedUrl: "http://gambatte.sourceforge.net/",
[ServiceNotApplicable(typeof(IDriveLight), typeof(IDriveLight))] singleInstance: false)]
[ServiceNotApplicable(new[] { typeof(IDriveLight) })]
public partial class Gameboy : IEmulator, IVideoProvider, ISoundProvider, ISaveRam, IStatable, IInputPollable, ICodeDataLogger, public partial class Gameboy : IEmulator, IVideoProvider, ISoundProvider, ISaveRam, IStatable, IInputPollable, ICodeDataLogger,
IBoardInfo, IDebuggable, ISettable<Gameboy.GambatteSettings, Gameboy.GambatteSyncSettings>, IBoardInfo, IDebuggable, ISettable<Gameboy.GambatteSettings, Gameboy.GambatteSyncSettings>,
IGameboyCommon, ICycleTiming, ILinkable IGameboyCommon, ICycleTiming, ILinkable
{ {
[CoreConstructor("GB", "GBC")] [CoreConstructor(new[] { "GB", "GBC" })]
public Gameboy(CoreComm comm, GameInfo game, byte[] file, object settings, object syncSettings, bool deterministic) public Gameboy(CoreComm comm, GameInfo game, byte[] file, object settings, object syncSettings, bool deterministic)
{ {
var ser = new BasicServiceProvider(this); var ser = new BasicServiceProvider(this);

View File

@ -7,7 +7,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
"sinamas/natt", "sinamas/natt",
isPorted: true, isPorted: true,
isReleased: true)] isReleased: true)]
[ServiceNotApplicable(typeof(IDriveLight))] [ServiceNotApplicable(new[] { typeof(IDriveLight) })]
public partial class GambatteLink : IEmulator, IVideoProvider, ISoundProvider, IInputPollable, ISaveRam, IStatable, ILinkable, public partial class GambatteLink : IEmulator, IVideoProvider, ISoundProvider, IInputPollable, ISaveRam, IStatable, ILinkable,
IBoardInfo, IDebuggable, ISettable<GambatteLink.GambatteLinkSettings, GambatteLink.GambatteLinkSyncSettings>, ICodeDataLogger IBoardInfo, IDebuggable, ISettable<GambatteLink.GambatteLinkSettings, GambatteLink.GambatteLinkSyncSettings>, ICodeDataLogger
{ {

View File

@ -14,7 +14,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64
portedVersion: "2.0", portedVersion: "2.0",
portedUrl: "https://code.google.com/p/mupen64plus/", portedUrl: "https://code.google.com/p/mupen64plus/",
singleInstance: true)] singleInstance: true)]
[ServiceNotApplicable(typeof(IDriveLight))] [ServiceNotApplicable(new[] { typeof(IDriveLight) })]
public partial class N64 : IEmulator, ISaveRam, IDebuggable, IStatable, IInputPollable, IDisassemblable, IRegionable, public partial class N64 : IEmulator, ISaveRam, IDebuggable, IStatable, IInputPollable, IDisassemblable, IRegionable,
ISettable<N64Settings, N64SyncSettings> ISettable<N64Settings, N64SyncSettings>
{ {

View File

@ -341,14 +341,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
//this will be used to track classes that implement boards //this will be used to track classes that implement boards
[AttributeUsage(AttributeTargets.Class)] [AttributeUsage(AttributeTargets.Class)]
public class INESBoardImplAttribute : Attribute { } public sealed class INESBoardImplAttribute : Attribute { }
//this tracks derived boards that shouldnt be used by the implementation scanner //this tracks derived boards that shouldnt be used by the implementation scanner
[AttributeUsage(AttributeTargets.Class)] [AttributeUsage(AttributeTargets.Class)]
public class INESBoardImplCancelAttribute : Attribute { } public sealed class INESBoardImplCancelAttribute : Attribute { }
static List<Type> INESBoardImplementors = new List<Type>(); static List<Type> INESBoardImplementors = new List<Type>();
//flags it as being priority, i.e. in the top of the list //flags it as being priority, i.e. in the top of the list
[AttributeUsage(AttributeTargets.Class)] [AttributeUsage(AttributeTargets.Class)]
public class INESBoardImplPriorityAttribute : Attribute { } public sealed class INESBoardImplPriorityAttribute : Attribute { }
static INESBoard CreateBoardInstance(Type boardType) static INESBoard CreateBoardInstance(Type boardType)
{ {
@ -736,7 +736,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
} }
[AttributeUsage(AttributeTargets.Field)] [AttributeUsage(AttributeTargets.Field)]
public class MapperPropAttribute : Attribute public sealed class MapperPropAttribute : Attribute
{ {
public string Name { get; } public string Name { get; }

View File

@ -16,8 +16,9 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.QuickNES
isPorted: true, isPorted: true,
isReleased: true, isReleased: true,
portedVersion: "0.7.0", portedVersion: "0.7.0",
portedUrl: "https://github.com/kode54/QuickNES")] portedUrl: "https://github.com/kode54/QuickNES",
[ServiceNotApplicable(typeof(IDriveLight))] singleInstance: false)]
[ServiceNotApplicable(new[] { typeof(IDriveLight) })]
public partial class QuickNES : IEmulator, IVideoProvider, ISoundProvider, ISaveRam, IInputPollable, IBoardInfo, public partial class QuickNES : IEmulator, IVideoProvider, ISoundProvider, ISaveRam, IInputPollable, IBoardInfo,
IStatable, IDebuggable, ISettable<QuickNES.QuickNESSettings, QuickNES.QuickNESSyncSettings>, Cores.Nintendo.NES.INESPPUViewable IStatable, IDebuggable, ISettable<QuickNES.QuickNESSettings, QuickNES.QuickNESSyncSettings>, Cores.Nintendo.NES.INESPPUViewable
{ {

View File

@ -23,8 +23,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES
isPorted: true, isPorted: true,
isReleased: true, isReleased: true,
portedVersion: "v87", portedVersion: "v87",
portedUrl: "http://byuu.org/")] portedUrl: "http://byuu.org/",
[ServiceNotApplicable(typeof(IDriveLight))] singleInstance: false)]
[ServiceNotApplicable(new[] { typeof(IDriveLight) })]
public unsafe partial class LibsnesCore : IEmulator, IVideoProvider, ISaveRam, IStatable, IInputPollable, IRegionable, ICodeDataLogger, public unsafe partial class LibsnesCore : IEmulator, IVideoProvider, ISaveRam, IStatable, IInputPollable, IRegionable, ICodeDataLogger,
IDebuggable, ISettable<LibsnesCore.SnesSettings, LibsnesCore.SnesSyncSettings> IDebuggable, ISettable<LibsnesCore.SnesSettings, LibsnesCore.SnesSyncSettings>
{ {

View File

@ -11,7 +11,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES9X
{ {
[Core("Snes9x", "", true, true, [Core("Snes9x", "", true, true,
"5e0319ab3ef9611250efb18255186d0dc0d7e125", "https://github.com/snes9xgit/snes9x", false)] "5e0319ab3ef9611250efb18255186d0dc0d7e125", "https://github.com/snes9xgit/snes9x", false)]
[ServiceNotApplicable(typeof(IDriveLight))] [ServiceNotApplicable(new[] { typeof(IDriveLight) })]
public class Snes9x : WaterboxCore, public class Snes9x : WaterboxCore,
ISettable<Snes9x.Settings, Snes9x.SyncSettings>, IRegionable ISettable<Snes9x.Settings, Snes9x.SyncSettings>, IRegionable
{ {

View File

@ -11,7 +11,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.SubNESHawk
"", "",
isPorted: false, isPorted: false,
isReleased: true)] isReleased: true)]
[ServiceNotApplicable(typeof(IDriveLight))] [ServiceNotApplicable(new[] { typeof(IDriveLight) })]
public partial class SubNESHawk : IEmulator, ISaveRam, IDebuggable, IStatable, IInputPollable, IRegionable, public partial class SubNESHawk : IEmulator, ISaveRam, IDebuggable, IStatable, IInputPollable, IRegionable,
IBoardInfo, ISettable<NES.NES.NESSettings, NES.NES.NESSyncSettings>, INESPPUViewable IBoardInfo, ISettable<NES.NES.NESSettings, NES.NES.NESSyncSettings>, INESPPUViewable
{ {

View File

@ -19,7 +19,7 @@ namespace BizHawk.Emulation.Cores.PCEngine
public sealed partial class PCEngine : IEmulator, ISaveRam, IInputPollable, public sealed partial class PCEngine : IEmulator, ISaveRam, IInputPollable,
IDebuggable, ISettable<PCEngine.PCESettings, PCEngine.PCESyncSettings>, IDriveLight, ICodeDataLogger IDebuggable, ISettable<PCEngine.PCESettings, PCEngine.PCESyncSettings>, IDriveLight, ICodeDataLogger
{ {
[CoreConstructor("PCE", "SGX")] [CoreConstructor(new[] { "PCE", "SGX" })]
public PCEngine(CoreComm comm, GameInfo game, byte[] rom, object settings, object syncSettings) public PCEngine(CoreComm comm, GameInfo game, byte[] rom, object settings, object syncSettings)
{ {
CoreComm = comm; CoreComm = comm;

View File

@ -8,7 +8,7 @@ namespace BizHawk.Emulation.Cores.Sega.GGHawkLink
"", "",
isPorted: false, isPorted: false,
isReleased: false)] isReleased: false)]
[ServiceNotApplicable(typeof(IDriveLight))] [ServiceNotApplicable(new[] { typeof(IDriveLight) })]
public partial class GGHawkLink : IEmulator, ISaveRam, IDebuggable, IStatable, IInputPollable, IRegionable, ILinkable, public partial class GGHawkLink : IEmulator, ISaveRam, IDebuggable, IStatable, IInputPollable, IRegionable, ILinkable,
ISettable<GGHawkLink.GGLinkSettings, GGHawkLink.GGLinkSyncSettings> ISettable<GGHawkLink.GGLinkSettings, GGHawkLink.GGLinkSyncSettings>
{ {

View File

@ -19,11 +19,11 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem
"Vecna", "Vecna",
isPorted: false, isPorted: false,
isReleased: true)] isReleased: true)]
[ServiceNotApplicable(typeof(IDriveLight))] [ServiceNotApplicable(new[] { typeof(IDriveLight) })]
public partial class SMS : IEmulator, ISaveRam, IInputPollable, IRegionable, public partial class SMS : IEmulator, ISaveRam, IInputPollable, IRegionable,
IDebuggable, ISettable<SMS.SmsSettings, SMS.SmsSyncSettings>, ICodeDataLogger IDebuggable, ISettable<SMS.SmsSettings, SMS.SmsSyncSettings>, ICodeDataLogger
{ {
[CoreConstructor("SMS", "SG", "GG")] [CoreConstructor(new[] { "SMS", "SG", "GG" })]
public SMS(CoreComm comm, GameInfo game, byte[] rom, object settings, object syncSettings) public SMS(CoreComm comm, GameInfo game, byte[] rom, object settings, object syncSettings)
{ {
ServiceProvider = new BasicServiceProvider(this); ServiceProvider = new BasicServiceProvider(this);

View File

@ -10,6 +10,8 @@ namespace BizHawk.Emulation.Cores.Sony.PSP
"hrydgard", "hrydgard",
isPorted: true, isPorted: true,
isReleased: false, isReleased: false,
portedVersion: null,
portedUrl: null,
singleInstance: true)] singleInstance: true)]
public class PSP : IEmulator, IVideoProvider, ISoundProvider public class PSP : IEmulator, IVideoProvider, ISoundProvider
{ {

View File

@ -6,8 +6,8 @@ using BizHawk.Emulation.Common;
namespace BizHawk.Emulation.Cores.WonderSwan namespace BizHawk.Emulation.Cores.WonderSwan
{ {
[Core("Cygne/Mednafen", "Dox, Mednafen Team", true, true, "0.9.36.5", "http://mednafen.sourceforge.net/")] [Core("Cygne/Mednafen", "Dox, Mednafen Team", true, true, "0.9.36.5", "http://mednafen.sourceforge.net/", false)]
[ServiceNotApplicable(typeof(IDriveLight), typeof(IRegionable))] [ServiceNotApplicable(new[] { typeof(IDriveLight), typeof(IRegionable) })]
public partial class WonderSwan : IEmulator, IVideoProvider, ISoundProvider, public partial class WonderSwan : IEmulator, IVideoProvider, ISoundProvider,
IInputPollable, IDebuggable IInputPollable, IDebuggable
{ {

View File

@ -177,15 +177,21 @@ namespace BizHawk.Emulation.Cores
} }
[AttributeUsage(AttributeTargets.Constructor)] [AttributeUsage(AttributeTargets.Constructor)]
public class CoreConstructorAttribute : Attribute public sealed class CoreConstructorAttribute : Attribute
{ {
private readonly List<string> _systems = new List<string>(); private readonly List<string> _systems = new List<string>();
public CoreConstructorAttribute(params string[] systems) /// <remarks>TODO neither array nor <see cref="IEnumerable{T}"/> is the correct collection to be using here, try <see cref="IReadOnlyList{T}"/>/<see cref="IReadOnlyCollection{T}"/> instead</remarks>
public CoreConstructorAttribute(string[] systems)
{ {
_systems.AddRange(systems); _systems.AddRange(systems);
} }
public CoreConstructorAttribute(string system)
{
_systems.Add(system);
}
public IEnumerable<string> Systems => _systems; public IEnumerable<string> Systems => _systems;
} }
} }

View File

@ -11,8 +11,8 @@ using BizHawk.Emulation.Common;
namespace BizHawk.Emulation.Cores.Libretro namespace BizHawk.Emulation.Cores.Libretro
{ {
[Core("Libretro", "zeromus")] [Core("Libretro", "zeromus", isPorted: false, isReleased: false)]
[ServiceNotApplicable(typeof(IDriveLight))] [ServiceNotApplicable(new[] { typeof(IDriveLight) })]
public unsafe partial class LibretroCore : IEmulator, ISettable<LibretroCore.Settings, LibretroCore.SyncSettings>, public unsafe partial class LibretroCore : IEmulator, ISettable<LibretroCore.Settings, LibretroCore.SyncSettings>,
ISaveRam, IStatable, IVideoProvider, IInputPollable ISaveRam, IStatable, IVideoProvider, IInputPollable
{ {