WIP
DirectOutput framework for virtual pinball cabinets WIP
Go to:
Overview 
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;
6 using System.Xml.Serialization;
7 using DirectOutput.Cab.Toys;
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 }
The namespace DirectOutput.Cab.Toys contains all toy related classes.
Common interface for toys supporting analog alpha layers.
Object containing a analog value (0-255) and a alpha value (0-255).
Definition: AnalogAlpha.cs:11
Table.Table Table
The table which contains the effect.
Abstract base class for IEffect objects. This class inherits NamedItemBase and implements IEffect...
Definition: EffectBase.cs:15
The namespace DirectOutput.Cab contains all cabinet related classes like the Cabinet class itself...
Definition: Cab.cs:16
Base class for effects controlling a single AnalogToy object.
Namespace for objects dealing with layers
override void Finish()
Finish does all necessary cleanupwork before the effect is discarded.
override void Init(Table.Table Table)
Initializes the effect.
The namespace DirectOutput.General contains classes for general use.