Exemplo n.º 1
0
        protected LinkedList <IModifier> BuildModifierStack()
        {
            LinkedList <IModifier> modifiers = new LinkedList <IModifier>();
            bool showDebugDivider            = false;

            List <InputMessage> inputMessages = _inputAdapter.GetUpdates();

            foreach (IController controller in _controllers)
            {
                foreach (InputMessage inputMessage in inputMessages)
                {
                    controller.ProcessMessage(inputMessage);

                    if (!inputMessage.Propogate)
                    {
                        break;
                    }
                }
                List <IModifier> cModifiers = controller.GetModifiers();
                if (cModifiers.Count > 0)
                {
                    //Debug.Log("Controller: " + controller.GetType().Name + " Modifiers: " + cModifiers.Count);
                    //showDebugDivider = true;
                }
                foreach (IModifier modifier in cModifiers)
                {
                    modifiers.AddLast(modifier);
                }
            }

            if (showDebugDivider)
            {
                Debug.Log("------------");
            }

            return(modifiers);
        }