DirectOutputR1
DirectOutput framework R1 for virtual pinball cabinets.
Go to:
Overview 
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Macros Pages
AnanlogToyEffectBase.cs
Go to the documentation of this file.
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Text;
5 using DirectOutput.Cab.Toys.Layer;
6 using System.Xml.Serialization;
7 
8 namespace DirectOutput.FX.AnalogToyFX
9 {
13  public abstract class AnanlogToyEffectBase : EffectBase
14  {
18  protected Table.Table Table;
19 
20  private string _ToyName;
21 
22 
29  public string ToyName
30  {
31  get { return _ToyName; }
32  set
33  {
34  if (_ToyName != value)
35  {
36  _ToyName = value;
37  Toy = null;
38  }
39  }
40  }
41 
42 
43  private int _Layer = 0;
44 
51  public int Layer
52  {
53  get { return _Layer; }
54  set { _Layer = value; }
55  }
56 
57 
58 
59 
64  [XmlIgnoreAttribute]
65  public IAnalogAlphaToy Toy{get;protected set;}
66 
67  private void ResolveName(Table.Table Table)
68  {
69 
70  if (!ToyName.IsNullOrWhiteSpace() && Table.Pinball.Cabinet.Toys.Contains(ToyName))
71  {
72  if (Table.Pinball.Cabinet.Toys[ToyName] is IAnalogAlphaToy)
73  {
74  Toy = (IAnalogAlphaToy)Table.Pinball.Cabinet.Toys[ToyName];
75  }
76 
77  }
78  }
79 
84  public override void Init(Table.Table Table)
85  {
86  this.Table = Table;
87  ResolveName(Table);
88  }
89 
93  public override void Finish()
94  {
95  base.Finish();
96  Toy = null;
97  this.Table = null;
98  }
99 
100  }
101 }