Exemple #1
0
        private bool ValidateInputs(List <LZFighterStateTransition.Input> inputs)
        {
            bool result = true;

            foreach (var input in inputs)
            {
                LZFIGHTERINPUTEVENT inputEvent = input.ev;
                if (fighter.invertHorizontal)
                {
                    if (inputEvent == LZFIGHTERINPUTEVENT.RIGHT)
                    {
                        inputEvent = LZFIGHTERINPUTEVENT.LEFT;
                    }
                    else if (inputEvent == LZFIGHTERINPUTEVENT.LEFT)
                    {
                        inputEvent = LZFIGHTERINPUTEVENT.RIGHT;
                    }
                }
                InputObject inputObject = fighter.controller.GetInput(inputEvent);
                bool        value       = false;
                switch (input.type)
                {
                case LZFighterStateTransition.INPUT_TYPE.DOWN:
                    value = inputObject.GetDown();
                    break;

                case LZFighterStateTransition.INPUT_TYPE.UP:
                    value = inputObject.GetUp();
                    break;

                case LZFighterStateTransition.INPUT_TYPE.VALUE:
                    value = inputObject.Get();
                    break;

                default:
                    break;
                }
                result &= (input.no)?!value:value;
            }
            return(result);
        }
Exemple #2
0
        public bool ValidateInput(LZFighterStateTransition.Input input)
        {
            LZFIGHTERINPUTEVENT inputEvent = input.ev;

            if (invertHorizontal)
            {
                if (inputEvent == LZFIGHTERINPUTEVENT.RIGHT)
                {
                    inputEvent = LZFIGHTERINPUTEVENT.LEFT;
                }
                else if (inputEvent == LZFIGHTERINPUTEVENT.LEFT)
                {
                    inputEvent = LZFIGHTERINPUTEVENT.RIGHT;
                }
            }
            InputObject inputObject = controller.GetInput(inputEvent);
            bool        value       = false;

            switch (input.type)
            {
            case LZFighterStateTransition.INPUT_TYPE.DOWN:
                value = inputObject.GetDown();
                break;

            case LZFighterStateTransition.INPUT_TYPE.UP:
                value = inputObject.GetUp();
                break;

            case LZFighterStateTransition.INPUT_TYPE.VALUE:
                value = inputObject.Get();
                break;

            default:
                break;
            }
            return(value);
        }