Example #1
0
    public void Update()
    {
        AState currentState = GetCurrentState();

        if (currentState != null)
        {
            currentState.Update();
        }
    }
Example #2
0
 protected override void Update(GameTime gameTime)
 {
     if (IsActive)
     {
         _currentState.Update(gameTime);
         _currentState.PostUpdate(gameTime);
         base.Update(gameTime);
     }
 }
Example #3
0
    public void Update()
    {
        AState currentState = Top(StateStack);

        if (currentState != null)
        {
            currentState.Update();

            if (currentState.IsComplete)
            {
                currentState.Exit();
                StateStack = StateStack.Where(x => !x.IsComplete).ToList();

                /* We don't enter in the same loop as an exit, or the states may conflict. */
                currentState = Top(StateStack);

                WaitingToFinish = currentState == null;
            }
        }
    }
Example #4
0
 // Update is called once per frame
 void Update()
 {
     state.Update();
 }