using System;
using System.Collections.Generic;
using System.Text;
namespace Wayne.Lib.StateEngine.Generic
{
///
/// Generic timeout 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 TimeoutState : TimeoutState where TData : StateData
{
#region Fields
private IStateWithData stateWithData;
#endregion
#region Properties
///
/// Gets the state data for this state.
///
protected TData Data
{
get
{
if (stateWithData == null)
{
stateWithData = StateData.GetParentCompositeStateWithStateData(this);
}
return stateWithData.StateData as TData;
}
}
#endregion
}
}