public void RemoveHeadState() { if (StateStack.Count < 1) { throw new Exception("There are no more states to remove"); } StateStack.RemoveAt(0); }
public void PopState() { if (StateStack.Count > 0) { StateStack.RemoveAt(0); } if (StateStack.Count > 0) { var state = StateStack.ElementAt(0); NextState = state; NextState.OnEnter(); } }
public void PopState() { if (StateStack.Count < 1) { throw new Exception("There are no more states to pop"); } var last = StateStack.Last(); StateStack.RemoveAt(StateStack.Count - 1); Position = last.Position; Mode = last.Mode; }
public void PopState() { if (StateStack.Count > 0) { StateStack.RemoveAt(0); } if (StateStack.Count > 0) { string state = StateStack.ElementAt(0); NextState = state; States[NextState].OnEnter(); States[NextState].TransitionValue = 0.0f; States[NextState].Transitioning = GameState.TransitionMode.Entering; if (CurrentState != "") { States[CurrentState].Transitioning = GameState.TransitionMode.Exiting; States[CurrentState].TransitionValue = 0.0f; } } }