more attribute renaming
This commit is contained in:
parent
c6e0e9fa57
commit
5d855ef60b
|
@ -37,8 +37,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
Services.Add(si.TypeName, si);
|
||||
}
|
||||
|
||||
var notapplicableAttr = ((ServiceNotApplicable)Attribute
|
||||
.GetCustomAttribute(emu.GetType(), typeof(ServiceNotApplicable)));
|
||||
var notapplicableAttr = ((ServiceNotApplicableAttribute)Attribute
|
||||
.GetCustomAttribute(emu.GetType(), typeof(ServiceNotApplicableAttribute)));
|
||||
|
||||
if (notapplicableAttr != null)
|
||||
{
|
||||
|
|
|
@ -84,10 +84,10 @@ namespace BizHawk.Client.EmuHawk
|
|||
.GetTypes()
|
||||
.Where(t => typeof(IVirtualPadSchema)
|
||||
.IsAssignableFrom(t) && t.GetCustomAttributes(false)
|
||||
.OfType<SchemaAttributes>()
|
||||
.OfType<SchemaAttribute>()
|
||||
.Any())
|
||||
.FirstOrDefault(t => t.GetCustomAttributes(false)
|
||||
.OfType<SchemaAttributes>()
|
||||
.OfType<SchemaAttribute>()
|
||||
.First().SystemId == Emulator.SystemId);
|
||||
|
||||
if (schemaType != null)
|
||||
|
|
|
@ -6,7 +6,7 @@ using BizHawk.Emulation.Cores.Atari.Atari2600;
|
|||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
[SchemaAttributes("A26")]
|
||||
[Schema("A26")]
|
||||
public class A26Schema : IVirtualPadSchema
|
||||
{
|
||||
public IEnumerable<PadSchema> GetPadSchemas(IEmulator core)
|
||||
|
|
|
@ -7,7 +7,7 @@ using BizHawk.Emulation.Cores.Atari.A7800Hawk;
|
|||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
[SchemaAttributes("A7800Hawk")]
|
||||
[Schema("A7800Hawk")]
|
||||
public class A7800HawkSchema : IVirtualPadSchema
|
||||
{
|
||||
private string UnpluggedControllerName => typeof(UnpluggedController).DisplayName();
|
||||
|
|
|
@ -6,7 +6,7 @@ using BizHawk.Emulation.Cores.Atari.Atari7800;
|
|||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
[SchemaAttributes("A78")]
|
||||
[Schema("A78")]
|
||||
public class A78Schema : IVirtualPadSchema
|
||||
{
|
||||
public IEnumerable<PadSchema> GetPadSchemas(IEmulator core)
|
||||
|
|
|
@ -5,7 +5,7 @@ using BizHawk.Emulation.Common;
|
|||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
[SchemaAttributes("AppleII")]
|
||||
[Schema("AppleII")]
|
||||
public class AppleIISchema : IVirtualPadSchema
|
||||
{
|
||||
public IEnumerable<PadSchema> GetPadSchemas(IEmulator core)
|
||||
|
|
|
@ -5,7 +5,7 @@ using BizHawk.Emulation.Common;
|
|||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
[SchemaAttributes("C64")]
|
||||
[Schema("C64")]
|
||||
public class C64Schema : IVirtualPadSchema
|
||||
{
|
||||
public IEnumerable<PadSchema> GetPadSchemas(IEmulator core)
|
||||
|
|
|
@ -6,7 +6,7 @@ using BizHawk.Emulation.Cores.ColecoVision;
|
|||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
[SchemaAttributes("Coleco")]
|
||||
[Schema("Coleco")]
|
||||
public class ColecoSchema : IVirtualPadSchema
|
||||
{
|
||||
public IEnumerable<PadSchema> GetPadSchemas(IEmulator core)
|
||||
|
|
|
@ -5,7 +5,7 @@ using BizHawk.Emulation.Common;
|
|||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
[SchemaAttributes("DGB")]
|
||||
[Schema("DGB")]
|
||||
public class DualGBSchema : IVirtualPadSchema
|
||||
{
|
||||
public IEnumerable<PadSchema> GetPadSchemas(IEmulator core)
|
||||
|
|
|
@ -6,7 +6,7 @@ using BizHawk.Emulation.Cores.Nintendo.GBA;
|
|||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
[SchemaAttributes("GBA")]
|
||||
[Schema("GBA")]
|
||||
public class GBASchema : IVirtualPadSchema
|
||||
{
|
||||
public IEnumerable<PadSchema> GetPadSchemas(IEmulator core)
|
||||
|
|
|
@ -5,7 +5,7 @@ using BizHawk.Emulation.Common;
|
|||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
[SchemaAttributes("GB")]
|
||||
[Schema("GB")]
|
||||
public class GBSchema : IVirtualPadSchema
|
||||
{
|
||||
public IEnumerable<PadSchema> GetPadSchemas(IEmulator core)
|
||||
|
|
|
@ -6,7 +6,7 @@ using BizHawk.Emulation.Cores.Consoles.Sega.gpgx;
|
|||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
[SchemaAttributes("GEN")]
|
||||
[Schema("GEN")]
|
||||
public class GenSchema : IVirtualPadSchema
|
||||
{
|
||||
public IEnumerable<PadSchema> GetPadSchemas(IEmulator core)
|
||||
|
|
|
@ -7,7 +7,7 @@ using BizHawk.Emulation.Cores.Intellivision;
|
|||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
[SchemaAttributes("INTV")]
|
||||
[Schema("INTV")]
|
||||
public class IntvSchema : IVirtualPadSchema
|
||||
{
|
||||
private string UnpluggedControllerName => typeof(UnpluggedController).DisplayName();
|
||||
|
|
|
@ -5,7 +5,7 @@ using BizHawk.Emulation.Common;
|
|||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
[SchemaAttributes("Lynx")]
|
||||
[Schema("Lynx")]
|
||||
public class LynxSchema : IVirtualPadSchema
|
||||
{
|
||||
public IEnumerable<PadSchema> GetPadSchemas(IEmulator core)
|
||||
|
|
|
@ -6,7 +6,7 @@ using BizHawk.Emulation.Cores.Nintendo.N64;
|
|||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
[SchemaAttributes("N64")]
|
||||
[Schema("N64")]
|
||||
public class N64Schema : IVirtualPadSchema
|
||||
{
|
||||
public IEnumerable<PadSchema> GetPadSchemas(IEmulator core)
|
||||
|
|
|
@ -9,7 +9,7 @@ using BizHawk.Emulation.Cores.Consoles.Nintendo.QuickNES;
|
|||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
[SchemaAttributes("NES")]
|
||||
[Schema("NES")]
|
||||
public class NesSchema : IVirtualPadSchema
|
||||
{
|
||||
public IEnumerable<PadSchema> GetPadSchemas(IEmulator core)
|
||||
|
|
|
@ -5,7 +5,7 @@ using BizHawk.Emulation.Common;
|
|||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
[SchemaAttributes("NGP")]
|
||||
[Schema("NGP")]
|
||||
public class NgpSchema : IVirtualPadSchema
|
||||
{
|
||||
public IEnumerable<PadSchema> GetPadSchemas(IEmulator core)
|
||||
|
|
|
@ -7,7 +7,7 @@ using BizHawk.Emulation.Cores.Sony.PSX;
|
|||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
[SchemaAttributes("PSX")]
|
||||
[Schema("PSX")]
|
||||
public class PSXSchema : IVirtualPadSchema
|
||||
{
|
||||
public IEnumerable<PadSchema> GetPadSchemas(IEmulator core)
|
||||
|
|
|
@ -5,10 +5,10 @@ using BizHawk.Emulation.Common;
|
|||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
[SchemaAttributes("PCECD")]
|
||||
[Schema("PCECD")]
|
||||
public class PceCdSchema : PceSchema { }
|
||||
|
||||
[SchemaAttributes("PCE")]
|
||||
[Schema("PCE")]
|
||||
public class PceSchema : IVirtualPadSchema
|
||||
{
|
||||
public IEnumerable<PadSchema> GetPadSchemas(IEmulator core)
|
||||
|
|
|
@ -8,7 +8,7 @@ using BizHawk.Emulation.Cores.Consoles.Sega.Saturn;
|
|||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
[SchemaAttributes("SAT")]
|
||||
[Schema("SAT")]
|
||||
public class SaturnSchema : IVirtualPadSchema
|
||||
{
|
||||
public IEnumerable<PadSchema> GetPadSchemas(IEmulator core)
|
||||
|
|
|
@ -3,14 +3,14 @@
|
|||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Class)]
|
||||
public class SchemaAttributes : Attribute
|
||||
public class SchemaAttribute : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the system id associated with this schema
|
||||
/// </summary>
|
||||
public string SystemId { get; private set; }
|
||||
|
||||
public SchemaAttributes(string systemId)
|
||||
public SchemaAttribute(string systemId)
|
||||
{
|
||||
SystemId = systemId;
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ using BizHawk.Emulation.Cores.Sega.MasterSystem;
|
|||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
[SchemaAttributes("SMS")]
|
||||
[Schema("SMS")]
|
||||
public class SmsSchema : IVirtualPadSchema
|
||||
{
|
||||
public IEnumerable<PadSchema> GetPadSchemas(IEmulator core)
|
||||
|
|
|
@ -7,7 +7,7 @@ using BizHawk.Emulation.Cores.Nintendo.SNES9X;
|
|||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
[SchemaAttributes("SNES")]
|
||||
[Schema("SNES")]
|
||||
public class SnesSchema : IVirtualPadSchema
|
||||
{
|
||||
public IEnumerable<PadSchema> GetPadSchemas(IEmulator core)
|
||||
|
|
|
@ -5,7 +5,7 @@ using BizHawk.Emulation.Common;
|
|||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
[SchemaAttributes("VB")]
|
||||
[Schema("VB")]
|
||||
public class VirtualBoySchema : IVirtualPadSchema
|
||||
{
|
||||
public IEnumerable<PadSchema> GetPadSchemas(IEmulator core)
|
||||
|
|
|
@ -5,7 +5,7 @@ using BizHawk.Emulation.Common;
|
|||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
[SchemaAttributes("WSWAN")]
|
||||
[Schema("WSWAN")]
|
||||
public class WonderSwanSchema : IVirtualPadSchema
|
||||
{
|
||||
public IEnumerable<PadSchema> GetPadSchemas(IEmulator core)
|
||||
|
|
|
@ -371,7 +371,7 @@ namespace BizHawk.Emulation.Common.IEmulatorExtensions
|
|||
public static bool IsImplemented(this MethodInfo info)
|
||||
{
|
||||
// If a method is marked as Not implemented, it is not implemented no matter what the body is
|
||||
if (info.GetCustomAttributes(false).Any(a => a is FeatureNotImplemented))
|
||||
if (info.GetCustomAttributes(false).Any(a => a is FeatureNotImplementedAttribute))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -388,7 +388,7 @@ namespace BizHawk.Emulation.Common.IEmulatorExtensions
|
|||
|
||||
public static bool IsImplemented(this PropertyInfo info)
|
||||
{
|
||||
return !info.GetCustomAttributes(false).Any(a => a is FeatureNotImplemented);
|
||||
return !info.GetCustomAttributes(false).Any(a => a is FeatureNotImplementedAttribute);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -9,7 +9,7 @@ namespace BizHawk.Emulation.Common
|
|||
/// By Convention it should also throw a NotImplementedException
|
||||
/// Any feature that does not have this attribute is assumed to be implemented
|
||||
/// </summary>
|
||||
public class FeatureNotImplemented : Attribute
|
||||
public class FeatureNotImplementedAttribute : Attribute
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -21,9 +21,9 @@ namespace BizHawk.Emulation.Common
|
|||
/// assumed to be a "TODO" that needs to be done but hasn't been done yet
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Class)]
|
||||
public class ServiceNotApplicable : Attribute
|
||||
public class ServiceNotApplicableAttribute : Attribute
|
||||
{
|
||||
public ServiceNotApplicable(params Type[] types)
|
||||
public ServiceNotApplicableAttribute(params Type[] types)
|
||||
{
|
||||
NotApplicableTypes = types?.ToList() ?? new List<Type>();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue