Skip to content

Commit a27ed4b

Browse files
committed
gle: Add access to switch, coil and lamp statuses.
1 parent 45904d9 commit a27ed4b

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

VisualPinball.Engine.PinMAME.Unity/Runtime/PinMameGamelogicEngine.cs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,6 @@ public static DisplayFrameFormat GetDisplayFrameFormat(PinMameDisplayLayout layo
615615
throw new NotImplementedException($"Still unsupported segmented display format: {layout}.");
616616
}
617617

618-
619618
public void SetCoil(string n, bool value)
620619
{
621620
OnCoilChanged?.Invoke(this, new CoilEventArgs(n, value));
@@ -631,5 +630,20 @@ public void SetLamp(string id, Color color)
631630
OnLampColorChanged?.Invoke(this, new LampColorEventArgs(id, color));
632631
}
633632

633+
public float GetLamp(string id)
634+
{
635+
return _player.LampStatuses.ContainsKey(id) ? _player.LampStatuses[id] : 0;
636+
}
637+
638+
public bool GetSwitch(string id)
639+
{
640+
return _player.SwitchStatuses.ContainsKey(id) && _player.SwitchStatuses[id].IsSwitchEnabled;
641+
}
642+
643+
public bool GetCoil(string id)
644+
{
645+
return _player.CoilStatuses.ContainsKey(id) && _player.CoilStatuses[id];
646+
}
647+
634648
}
635649
}

0 commit comments

Comments
 (0)