public void Render( float moveFactor ) { if ( states.Count == 0 ) return; if ( currentState == null ) { currentState = defaultState; currentState.Enter(); } if ( currentState == null ) return; currentState.Render( moveFactor ); }
public void Update( float moveFactor ) { if ( states.Count == 0 ) return; if ( currentState == null ) { currentState = defaultState; currentState.Enter(); } if ( currentState == null ) return; int oldStateID = currentState.Type; goalID = currentState.CheckTransitions( moveFactor ); if ( goalID != oldStateID ) { if ( TransitionState( goalID ) ) { currentState.Exit(); currentState = goalState; currentState.Enter(); } } currentState.Update( moveFactor ); }