Don't expose Colecovision syncSettings, aquire sync settings the intended way instead

This commit is contained in:
adelikat 2017-05-30 12:37:47 -05:00
parent 95bea23aa5
commit c1a746c7d6
3 changed files with 16 additions and 9 deletions

View File

@ -18,7 +18,7 @@ namespace BizHawk.Client.EmuHawk
private void ColecoControllerSettings_Load(object sender, EventArgs e)
{
_syncSettings = (Global.Emulator as ColecoVision)._syncSettings.Clone();
_syncSettings = ((ColecoVision)Global.Emulator).GetSyncSettings().Clone();
var possibleControllers = ColecoVisionControllerDeck.ValidControllerTypes.Select(t => t.Key);

View File

@ -1,5 +1,4 @@
using System;
using System.Data;
using System.Linq;
using System.Windows.Forms;
@ -19,7 +18,7 @@ namespace BizHawk.Client.EmuHawk
private void IntvControllerSettings_Load(object sender, EventArgs e)
{
_syncSettings = (Global.Emulator as Intellivision).GetSyncSettings().Clone();
_syncSettings = ((Intellivision)Global.Emulator).GetSyncSettings().Clone();
var possibleControllers = IntellivisionControllerDeck.ValidControllerTypes.Select(t => t.Key);

View File

@ -10,7 +10,7 @@ namespace BizHawk.Emulation.Cores.ColecoVision
{
public ColecoSettings GetSettings()
{
return Settings.Clone();
return _settings.Clone();
}
public ColecoSyncSettings GetSyncSettings()
@ -20,7 +20,7 @@ namespace BizHawk.Emulation.Cores.ColecoVision
public bool PutSettings(ColecoSettings o)
{
Settings = o;
_settings = o;
return false;
}
@ -40,8 +40,8 @@ namespace BizHawk.Emulation.Cores.ColecoVision
}
}
public ColecoSettings Settings = new ColecoSettings();
public ColecoSyncSettings _syncSettings = new ColecoSyncSettings();
private ColecoSettings _settings = new ColecoSettings();
private ColecoSyncSettings _syncSettings = new ColecoSyncSettings();
public class ColecoSyncSettings
{
@ -53,7 +53,11 @@ namespace BizHawk.Emulation.Cores.ColecoVision
[JsonIgnore]
public string Port1
{
get { return _port1; }
get
{
return _port1;
}
set
{
if (!ColecoVisionControllerDeck.ValidControllerTypes.ContainsKey(value))
@ -68,7 +72,11 @@ namespace BizHawk.Emulation.Cores.ColecoVision
[JsonIgnore]
public string Port2
{
get { return _port2; }
get
{
return _port2;
}
set
{
if (!ColecoVisionControllerDeck.ValidControllerTypes.ContainsKey(value))