@@ -79,6 +79,7 @@ public GamelogicEngineLamp[] AvailableLamps {
79
79
public GamelogicEngineWire [ ] AvailableWires => _game ? . AvailableWires ?? Array . Empty < GamelogicEngineWire > ( ) ;
80
80
81
81
public event EventHandler < CoilEventArgs > OnCoilChanged ;
82
+ public event EventHandler < SwitchEventArgs2 > OnSwitchChanged ;
82
83
public event EventHandler < LampEventArgs > OnLampChanged ;
83
84
public event EventHandler < LampsEventArgs > OnLampsChanged ;
84
85
public event EventHandler < LampColorEventArgs > OnLampColorChanged ;
@@ -559,6 +560,8 @@ public void Switch(string id, bool isClosed)
559
560
} else {
560
561
Logger . Error ( $ "[PinMAME] Unknown switch \" { id } \" .") ;
561
562
}
563
+
564
+ OnSwitchChanged ? . Invoke ( this , new SwitchEventArgs2 ( id , isClosed ) ) ;
562
565
}
563
566
564
567
public static DisplayFrameFormat GetDisplayFrameFormat ( PinMameDisplayLayout layout )
@@ -611,5 +614,22 @@ public static DisplayFrameFormat GetDisplayFrameFormat(PinMameDisplayLayout layo
611
614
612
615
throw new NotImplementedException ( $ "Still unsupported segmented display format: { layout } .") ;
613
616
}
617
+
618
+
619
+ public void SetCoil ( string n , bool value )
620
+ {
621
+ OnCoilChanged ? . Invoke ( this , new CoilEventArgs ( n , value ) ) ;
622
+ }
623
+
624
+ public void SetLamp ( string id , int value , bool isCoil = false , LampSource source = LampSource . Lamp )
625
+ {
626
+ OnLampChanged ? . Invoke ( this , new LampEventArgs ( id , value , isCoil , source ) ) ;
627
+ }
628
+
629
+ public void SetLamp ( string id , Color color )
630
+ {
631
+ OnLampColorChanged ? . Invoke ( this , new LampColorEventArgs ( id , color ) ) ;
632
+ }
633
+
614
634
}
615
635
}
0 commit comments