From 278317685c24984f2960c4dfb191b7c3985e4ae3 Mon Sep 17 00:00:00 2001 From: nattthebear Date: Sun, 14 Jun 2020 11:47:02 -0400 Subject: [PATCH] actualportdata api --- .../Waterbox/NymaCore.Controller.cs | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/BizHawk.Emulation.Cores/Waterbox/NymaCore.Controller.cs b/src/BizHawk.Emulation.Cores/Waterbox/NymaCore.Controller.cs index a032100087..d40d6b07d9 100644 --- a/src/BizHawk.Emulation.Cores/Waterbox/NymaCore.Controller.cs +++ b/src/BizHawk.Emulation.Cores/Waterbox/NymaCore.Controller.cs @@ -32,6 +32,7 @@ namespace BizHawk.Emulation.Cores.Waterbox /// public string[] Devices { get; } public ControllerDefinition Definition { get; } + public List ActualPortData { get; set; } = new List(); public ControllerAdapter( List allPorts, IDictionary config, @@ -75,6 +76,12 @@ namespace BizHawk.Emulation.Cores.Waterbox throw new InvalidOperationException($"Fail: unknown controller device {portInfo.DefaultDeviceShortName}"); } + ActualPortData.Add(new PortResult + { + Port = portInfo, + Device = device + }); + var deviceInfo = device; var category = portInfo.FullName + " - " + deviceInfo.FullName; @@ -305,5 +312,23 @@ namespace BizHawk.Emulation.Cores.Waterbox { return new HashSet(); } + + public class PortResult + { + /// + /// The port, together with all of its potential contents + /// + public NPortInfoT Port { get; set; } + /// + /// What was actually plugged into the port + /// + public NDeviceInfoT Device { get; set; } + } + + /// + /// In a fully initialized core, holds information about what was actually plugged in. Please do not mutate it. + /// + /// + public List ActualPortData => _controllerAdapter.ActualPortData; } }