using System; using System.Collections.Generic; using System.Text; namespace Wayne.Lib.StateEngine.Generic { /// /// Generic pseudo state class that has a main object of a generic type. /// /// Specifies the type of the main object. /// Specifies the type of state data the state uses. public abstract class PseudoState : PseudoState where TData : StateData { #region Fields private IStateWithData dataCompositeState; #endregion #region Properties /// /// Gets the state data for this state. /// protected TData Data { get { if (dataCompositeState == null) { dataCompositeState = StateData.GetParentCompositeStateWithStateData(this); } return dataCompositeState.StateData as TData; } } #endregion } }