Move Virtual Pads schemata to Cores

This commit is contained in:
YoshiRulz 2020-12-22 18:37:27 +10:00
parent 790a09067e
commit 03b4ae18e0
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
33 changed files with 37 additions and 37 deletions

View File

@ -77,7 +77,7 @@ namespace BizHawk.Client.EmuHawk
Type schemaType; Type schemaType;
try try
{ {
schemaType = EmuHawk.ReflectionCache.Types.Where(typeof(IVirtualPadSchema).IsAssignableFrom) schemaType = Emulation.Cores.ReflectionCache.Types.Where(typeof(IVirtualPadSchema).IsAssignableFrom)
.Select(t => (SchemaType: t, Attr: t.GetCustomAttributes(false).OfType<SchemaAttribute>().FirstOrDefault())) .Select(t => (SchemaType: t, Attr: t.GetCustomAttributes(false).OfType<SchemaAttribute>().FirstOrDefault()))
.First(tuple => tuple.Attr?.SystemId == Emulator.SystemId) .First(tuple => tuple.Attr?.SystemId == Emulator.SystemId)
.SchemaType; .SchemaType;

View File

@ -2,7 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using BizHawk.Emulation.Common; using BizHawk.Emulation.Common;
namespace BizHawk.Client.EmuHawk namespace BizHawk.Emulation.Common
{ {
public interface IVirtualPadSchema public interface IVirtualPadSchema
{ {

View File

@ -1,7 +1,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing; using System.Drawing;
namespace BizHawk.Client.EmuHawk namespace BizHawk.Emulation.Common
{ {
public class PadSchema public class PadSchema
{ {

View File

@ -5,7 +5,7 @@ using System.Drawing;
using BizHawk.Emulation.Common; using BizHawk.Emulation.Common;
namespace BizHawk.Client.EmuHawk namespace BizHawk.Emulation.Common
{ {
public abstract class PadSchemaControl public abstract class PadSchemaControl
{ {

View File

@ -1,6 +1,6 @@
using System; using System;
namespace BizHawk.Client.EmuHawk namespace BizHawk.Emulation.Common
{ {
[AttributeUsage(AttributeTargets.Class)] [AttributeUsage(AttributeTargets.Class)]
public sealed class SchemaAttribute : Attribute public sealed class SchemaAttribute : Attribute

View File

@ -5,7 +5,7 @@ using System.Drawing;
using BizHawk.Emulation.Common; using BizHawk.Emulation.Common;
using BizHawk.Emulation.Cores.Atari.Atari2600; using BizHawk.Emulation.Cores.Atari.Atari2600;
namespace BizHawk.Client.EmuHawk namespace BizHawk.Emulation.Cores
{ {
[Schema("A26")] [Schema("A26")]
// ReSharper disable once UnusedMember.Global // ReSharper disable once UnusedMember.Global

View File

@ -6,7 +6,7 @@ using BizHawk.Emulation.Common;
using BizHawk.Common.ReflectionExtensions; using BizHawk.Common.ReflectionExtensions;
using BizHawk.Emulation.Cores.Atari.A7800Hawk; using BizHawk.Emulation.Cores.Atari.A7800Hawk;
namespace BizHawk.Client.EmuHawk namespace BizHawk.Emulation.Cores
{ {
[Schema("A78")] [Schema("A78")]
// ReSharper disable once UnusedMember.Global // ReSharper disable once UnusedMember.Global

View File

@ -4,7 +4,7 @@ using System.Drawing;
using BizHawk.Emulation.Common; using BizHawk.Emulation.Common;
namespace BizHawk.Client.EmuHawk namespace BizHawk.Emulation.Cores
{ {
[Schema("AppleII")] [Schema("AppleII")]
// ReSharper disable once UnusedMember.Global // ReSharper disable once UnusedMember.Global

View File

@ -4,7 +4,7 @@ using System.Drawing;
using BizHawk.Emulation.Common; using BizHawk.Emulation.Common;
namespace BizHawk.Client.EmuHawk namespace BizHawk.Emulation.Cores
{ {
[Schema("C64")] [Schema("C64")]
// ReSharper disable once UnusedMember.Global // ReSharper disable once UnusedMember.Global

View File

@ -5,7 +5,7 @@ using System.Linq;
using BizHawk.Emulation.Common; using BizHawk.Emulation.Common;
using BizHawk.Emulation.Cores.ColecoVision; using BizHawk.Emulation.Cores.ColecoVision;
namespace BizHawk.Client.EmuHawk namespace BizHawk.Emulation.Cores
{ {
[Schema("Coleco")] [Schema("Coleco")]
// ReSharper disable once UnusedMember.Global // ReSharper disable once UnusedMember.Global
@ -13,7 +13,7 @@ namespace BizHawk.Client.EmuHawk
{ {
public IEnumerable<PadSchema> GetPadSchemas(IEmulator core, Action<string> showMessageBox) public IEnumerable<PadSchema> GetPadSchemas(IEmulator core, Action<string> showMessageBox)
{ {
var deck = ((ColecoVision)core).ControllerDeck; var deck = ((ColecoVision.ColecoVision) core).ControllerDeck;
var ports = new[] { deck.Port1.GetType(), deck.Port2.GetType() }; var ports = new[] { deck.Port1.GetType(), deck.Port2.GetType() };
for (int i = 0; i < 2; i++) for (int i = 0; i < 2; i++)

View File

@ -4,7 +4,7 @@ using System.Drawing;
using BizHawk.Emulation.Common; using BizHawk.Emulation.Common;
namespace BizHawk.Client.EmuHawk namespace BizHawk.Emulation.Cores
{ {
[Schema("DGB")] [Schema("DGB")]
// ReSharper disable once UnusedMember.Global // ReSharper disable once UnusedMember.Global

View File

@ -5,7 +5,7 @@ using System.Drawing;
using BizHawk.Emulation.Common; using BizHawk.Emulation.Common;
using BizHawk.Emulation.Cores.Nintendo.GBA; using BizHawk.Emulation.Cores.Nintendo.GBA;
namespace BizHawk.Client.EmuHawk namespace BizHawk.Emulation.Cores
{ {
[Schema("GBA")] [Schema("GBA")]
// ReSharper disable once UnusedMember.Global // ReSharper disable once UnusedMember.Global

View File

@ -4,7 +4,7 @@ using System.Drawing;
using BizHawk.Emulation.Common; using BizHawk.Emulation.Common;
namespace BizHawk.Client.EmuHawk namespace BizHawk.Emulation.Cores
{ {
[Schema("GB")] [Schema("GB")]
// ReSharper disable once UnusedMember.Global // ReSharper disable once UnusedMember.Global

View File

@ -4,7 +4,7 @@ using System.Drawing;
using BizHawk.Emulation.Common; using BizHawk.Emulation.Common;
namespace BizHawk.Client.EmuHawk namespace BizHawk.Emulation.Cores
{ {
[Schema("GGL")] [Schema("GGL")]
// ReSharper disable once UnusedMember.Global // ReSharper disable once UnusedMember.Global

View File

@ -6,7 +6,7 @@ using System.Linq;
using BizHawk.Emulation.Common; using BizHawk.Emulation.Common;
using BizHawk.Emulation.Cores.Consoles.Sega.gpgx; using BizHawk.Emulation.Cores.Consoles.Sega.gpgx;
namespace BizHawk.Client.EmuHawk namespace BizHawk.Emulation.Cores
{ {
[Schema("GEN")] [Schema("GEN")]
// ReSharper disable once UnusedMember.Global // ReSharper disable once UnusedMember.Global

View File

@ -7,7 +7,7 @@ using BizHawk.Common.ReflectionExtensions;
using BizHawk.Emulation.Common; using BizHawk.Emulation.Common;
using BizHawk.Emulation.Cores.Intellivision; using BizHawk.Emulation.Cores.Intellivision;
namespace BizHawk.Client.EmuHawk namespace BizHawk.Emulation.Cores
{ {
[Schema("INTV")] [Schema("INTV")]
// ReSharper disable once UnusedMember.Global // ReSharper disable once UnusedMember.Global
@ -18,7 +18,7 @@ namespace BizHawk.Client.EmuHawk
public IEnumerable<PadSchema> GetPadSchemas(IEmulator core, Action<string> showMessageBox) public IEnumerable<PadSchema> GetPadSchemas(IEmulator core, Action<string> showMessageBox)
{ {
var intvSyncSettings = ((Intellivision)core).GetSyncSettings().Clone(); var intvSyncSettings = ((Intellivision.Intellivision) core).GetSyncSettings().Clone();
var port1 = intvSyncSettings.Port1; var port1 = intvSyncSettings.Port1;
var port2 = intvSyncSettings.Port2; var port2 = intvSyncSettings.Port2;

View File

@ -4,7 +4,7 @@ using System.Drawing;
using BizHawk.Emulation.Common; using BizHawk.Emulation.Common;
namespace BizHawk.Client.EmuHawk namespace BizHawk.Emulation.Cores
{ {
[Schema("Lynx")] [Schema("Lynx")]
// ReSharper disable once UnusedMember.Global // ReSharper disable once UnusedMember.Global

View File

@ -6,7 +6,7 @@ using BizHawk.Common;
using BizHawk.Emulation.Common; using BizHawk.Emulation.Common;
using BizHawk.Emulation.Cores.Nintendo.N64; using BizHawk.Emulation.Cores.Nintendo.N64;
namespace BizHawk.Client.EmuHawk namespace BizHawk.Emulation.Cores
{ {
[Schema("N64")] [Schema("N64")]
// ReSharper disable once UnusedMember.Global // ReSharper disable once UnusedMember.Global

View File

@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using BizHawk.Emulation.Common; using BizHawk.Emulation.Common;
namespace BizHawk.Client.EmuHawk.tools.VirtualPads.schema namespace BizHawk.Emulation.Cores
{ {
[Schema("NDS")] [Schema("NDS")]
// ReSharper disable once UnusedMember.Global // ReSharper disable once UnusedMember.Global

View File

@ -8,7 +8,7 @@ using BizHawk.Emulation.Cores.Nintendo.NES;
using BizHawk.Emulation.Cores.Nintendo.SubNESHawk; using BizHawk.Emulation.Cores.Nintendo.SubNESHawk;
using BizHawk.Emulation.Cores.Consoles.Nintendo.QuickNES; using BizHawk.Emulation.Cores.Consoles.Nintendo.QuickNES;
namespace BizHawk.Client.EmuHawk namespace BizHawk.Emulation.Cores
{ {
[Schema("NES")] [Schema("NES")]
// ReSharper disable once UnusedMember.Global // ReSharper disable once UnusedMember.Global

View File

@ -4,7 +4,7 @@ using System.Drawing;
using BizHawk.Emulation.Common; using BizHawk.Emulation.Common;
namespace BizHawk.Client.EmuHawk namespace BizHawk.Emulation.Cores
{ {
[Schema("NGP")] [Schema("NGP")]
// ReSharper disable once UnusedMember.Global // ReSharper disable once UnusedMember.Global

View File

@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using BizHawk.Emulation.Common; using BizHawk.Emulation.Common;
namespace BizHawk.Client.EmuHawk namespace BizHawk.Emulation.Cores
{ {
[Schema("O2")] [Schema("O2")]
// ReSharper disable once UnusedMember.Global // ReSharper disable once UnusedMember.Global

View File

@ -6,7 +6,7 @@ using BizHawk.Common;
using BizHawk.Emulation.Common; using BizHawk.Emulation.Common;
using BizHawk.Emulation.Cores.Sony.PSX; using BizHawk.Emulation.Cores.Sony.PSX;
namespace BizHawk.Client.EmuHawk namespace BizHawk.Emulation.Cores
{ {
[Schema("PSX")] [Schema("PSX")]
// ReSharper disable once UnusedMember.Global // ReSharper disable once UnusedMember.Global

View File

@ -8,7 +8,7 @@ using BizHawk.Emulation.Common;
using BizHawk.Emulation.Cores.PCEngine; using BizHawk.Emulation.Cores.PCEngine;
using BizHawk.Emulation.Cores.Waterbox; using BizHawk.Emulation.Cores.Waterbox;
namespace BizHawk.Client.EmuHawk namespace BizHawk.Emulation.Cores
{ {
[Schema("PCECD")] [Schema("PCECD")]
// ReSharper disable once UnusedMember.Global // ReSharper disable once UnusedMember.Global
@ -25,13 +25,13 @@ namespace BizHawk.Client.EmuHawk
{ {
return core switch return core switch
{ {
PCEngine pce => PceHawkSchemas(pce, showMessageBox), PCEngine.PCEngine pce => PceHawkSchemas(pce, showMessageBox),
NymaCore nyma => NymaSchemas(nyma, showMessageBox), NymaCore nyma => NymaSchemas(nyma, showMessageBox),
_ => Enumerable.Empty<PadSchema>() _ => Enumerable.Empty<PadSchema>()
}; };
} }
private static IEnumerable<PadSchema> PceHawkSchemas(PCEngine core, Action<string> showMessageBox) private static IEnumerable<PadSchema> PceHawkSchemas(PCEngine.PCEngine core, Action<string> showMessageBox)
{ {
var ss = core.GetSyncSettings(); var ss = core.GetSyncSettings();

View File

@ -7,7 +7,7 @@ using BizHawk.Common;
using BizHawk.Emulation.Common; using BizHawk.Emulation.Common;
using BizHawk.Emulation.Cores.Waterbox; using BizHawk.Emulation.Cores.Waterbox;
namespace BizHawk.Client.EmuHawk namespace BizHawk.Emulation.Cores
{ {
[Schema("PCFX")] [Schema("PCFX")]
// ReSharper disable once UnusedMember.Global // ReSharper disable once UnusedMember.Global

View File

@ -4,7 +4,7 @@ using System.Drawing;
using BizHawk.Emulation.Common; using BizHawk.Emulation.Common;
namespace BizHawk.Client.EmuHawk namespace BizHawk.Emulation.Cores
{ {
[Schema("SGB")] [Schema("SGB")]
// ReSharper disable once UnusedMember.Global // ReSharper disable once UnusedMember.Global

View File

@ -7,7 +7,7 @@ using BizHawk.Common;
using BizHawk.Emulation.Common; using BizHawk.Emulation.Common;
using BizHawk.Emulation.Cores.Waterbox; using BizHawk.Emulation.Cores.Waterbox;
namespace BizHawk.Client.EmuHawk namespace BizHawk.Emulation.Cores
{ {
[Schema("SAT")] [Schema("SAT")]
// ReSharper disable once UnusedMember.Global // ReSharper disable once UnusedMember.Global

View File

@ -4,7 +4,7 @@ using System.Drawing;
using BizHawk.Emulation.Common; using BizHawk.Emulation.Common;
using BizHawk.Emulation.Cores.Sega.MasterSystem; using BizHawk.Emulation.Cores.Sega.MasterSystem;
namespace BizHawk.Client.EmuHawk namespace BizHawk.Emulation.Cores
{ {
[Schema("SMS")] [Schema("SMS")]
// ReSharper disable once UnusedMember.Global // ReSharper disable once UnusedMember.Global

View File

@ -7,7 +7,7 @@ using BizHawk.Emulation.Cores.Nintendo.SNES;
using BizHawk.Emulation.Cores.Nintendo.SNES9X; using BizHawk.Emulation.Cores.Nintendo.SNES9X;
using BizHawk.Emulation.Cores.Waterbox; using BizHawk.Emulation.Cores.Waterbox;
namespace BizHawk.Client.EmuHawk namespace BizHawk.Emulation.Cores
{ {
[Schema("SNES")] [Schema("SNES")]
// ReSharper disable once UnusedMember.Global // ReSharper disable once UnusedMember.Global

View File

@ -5,7 +5,7 @@ using System.Drawing;
using BizHawk.Emulation.Common; using BizHawk.Emulation.Common;
using BizHawk.Emulation.Cores.Consoles.Vectrex; using BizHawk.Emulation.Cores.Consoles.Vectrex;
namespace BizHawk.Client.EmuHawk namespace BizHawk.Emulation.Cores
{ {
[Schema("VEC")] [Schema("VEC")]
// ReSharper disable once UnusedMember.Global // ReSharper disable once UnusedMember.Global

View File

@ -4,7 +4,7 @@ using System.Drawing;
using BizHawk.Emulation.Common; using BizHawk.Emulation.Common;
namespace BizHawk.Client.EmuHawk namespace BizHawk.Emulation.Cores
{ {
[Schema("VB")] [Schema("VB")]
// ReSharper disable once UnusedMember.Global // ReSharper disable once UnusedMember.Global

View File

@ -4,7 +4,7 @@ using System.Drawing;
using BizHawk.Emulation.Common; using BizHawk.Emulation.Common;
namespace BizHawk.Client.EmuHawk namespace BizHawk.Emulation.Cores
{ {
[Schema("WSWAN")] [Schema("WSWAN")]
// ReSharper disable once UnusedMember.Global // ReSharper disable once UnusedMember.Global

View File

@ -4,7 +4,7 @@ using System.Drawing;
using BizHawk.Emulation.Common; using BizHawk.Emulation.Common;
namespace BizHawk.Client.EmuHawk namespace BizHawk.Emulation.Cores
{ {
[Schema("ZXSpectrum")] [Schema("ZXSpectrum")]
// ReSharper disable once UnusedMember.Global // ReSharper disable once UnusedMember.Global