DirectOuput Framework R2
DirectOutput framework R2 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 using DirectOutput.Cab.Toys;
8 using DirectOutput.General.Analog;
9 
10 namespace DirectOutput.FX.AnalogToyFX
11 {
15  public abstract class AnalogToyEffectBase : EffectBase
16  {
20  protected Table.Table Table;
21 
22  private string _ToyName;
23 
24 
31  public string ToyName
32  {
33  get { return _ToyName; }
34  set
35  {
36  if (_ToyName != value)
37  {
38  _ToyName = value;
39  Toy = null;
40  Layer = null;
41  }
42  }
43  }
44 
45  protected AnalogAlpha Layer { get; private set; }
46 
47  private int _LayerNr = 0;
48 
55  public int LayerNr
56  {
57  get { return _LayerNr; }
58  set { _LayerNr = value; }
59  }
60 
61 
62 
63 
68  [XmlIgnoreAttribute]
69  protected IAnalogAlphaToy Toy{get;private set;}
70 
71  private void ResolveName(Table.Table Table)
72  {
73 
74 
75  }
76 
81  public override void Init(Table.Table Table)
82  {
83  if (!ToyName.IsNullOrWhiteSpace() && Table.Pinball.Cabinet.Toys.Contains(ToyName))
84  {
85  if (Table.Pinball.Cabinet.Toys[ToyName] is IAnalogAlphaToy)
86  {
87  Toy = (IAnalogAlphaToy)Table.Pinball.Cabinet.Toys[ToyName];
88  Layer = Toy.Layers[LayerNr];
89  }
90 
91  }
92  this.Table = Table;
93  ResolveName(Table);
94  }
95 
99  public override void Finish()
100  {
101 
102  Toy = null;
103  this.Table = null;
104  base.Finish();
105  }
106 
107  }
108 }