Exemplo n.º 1
0
        /// <summary>
        /// Run the state's actions
        /// </summary>
        public void Run()
        {
            if (currentState == null && !runMyActionsAndSubStateActions)
            {
                foreach (StateAction sa in actions)
                {
                    sa(this);
                }
            }
            else
            {
                if (myRunOrder == ActionRunOrder.RunLast)
                {
                    currentState.Run();
                }

                foreach (StateAction sa in actions)
                {
                    sa(this);
                }

                if (myRunOrder == ActionRunOrder.RunFirst)
                {
                    currentState.Run();
                }
            }
        }