2 using System.Collections.Generic;
5 using System.Xml.Serialization;
15 private int _ActiveValue = -1;
25 get {
return _ActiveValue; }
26 set { _ActiveValue = value.Limit(-1, 255); }
29 private int _LowValue = 0;
39 get {
return _LowValue; }
40 set { _LowValue = value.Limit(0, 255); }
48 private int _DurationActiveMs = 500;
56 public int DurationActiveMs
58 get {
return _DurationActiveMs; }
59 set { _DurationActiveMs = value.Limit(1,
int.MaxValue); }
63 private int _DurationInactiveMs = 500;
71 public int DurationInactiveMs
73 get {
return _DurationInactiveMs; }
74 set { _DurationInactiveMs = value.Limit(1,
int.MaxValue); }
88 get {
return _UntriggerBehaviour; }
89 set { _UntriggerBehaviour = value; }
101 public bool Active {
get;
private set; }
104 private bool BlinkEnabled =
false;
105 private bool BlinkState =
false;
106 private int BlinkOrgTableElementDataValue = 1;
107 private Table.TableElementData BlinkTableElementData;
109 private void StartBlinking(Table.TableElementData TableElementData)
111 BlinkTableElementData = TableElementData;
112 BlinkOrgTableElementDataValue = BlinkTableElementData.Value;
124 BlinkTableElementData.Value = (HighValue >= 0 ? HighValue : BlinkOrgTableElementDataValue);
125 TriggerTargetEffect(BlinkTableElementData);
130 private void StopBlinking()
132 BlinkEnabled =
false;
135 Table.Pinball.Alarms.UnregisterAlarm(DoBlink);
136 BlinkTableElementData.Value = 0;
137 TriggerTargetEffect(BlinkTableElementData);
141 private void DoBlink()
143 BlinkState = !BlinkState;
146 BlinkTableElementData.Value = (HighValue >= 0 ? HighValue : BlinkOrgTableElementDataValue);
147 Table.Pinball.Alarms.RegisterAlarm(DurationActiveMs, DoBlink);
153 BlinkTableElementData.Value = LowValue;
154 Table.Pinball.Alarms.RegisterAlarm(DurationInactiveMs, DoBlink);
158 BlinkTableElementData.Value = 0;
161 TriggerTargetEffect(BlinkTableElementData);
172 public override void Trigger(Table.TableElementData TableElementData)
174 if (TargetEffect != null)
176 if (TableElementData.Value != 0)
178 StartBlinking(TableElementData);
197 Table.Pinball.Alarms.UnregisterAlarm(DoBlink);
override void Trigger(Table.TableElementData TableElementData)
Triggers the BlinkEffect with the given TableElementData. If the Value property of the TableElementD...
override void Finish()
Finishes the BlinkEffect.
Blink effect which triggers a TargetEffect at specified intervalls with active (org value of TableEle...
BlinkEffectUntriggerBehaviourEnum
Defines the untrigger behaviours for the blink effect.
Base class for effects targeting another effect.