Beispiel #1
0
        internal static void Input(Queue <InputAction> actions)
        {
            InputSolver tempSolver = new InputSolver();

            tempSolver.AxisInputAction.Add(GuiProperty.InputMoveX, new AxisInputActionSolvers());
            tempSolver.AxisInputAction.Add(GuiProperty.InputMoveY, new AxisInputActionSolvers());

            tempSolver.AxisInputAction[GuiProperty.InputMoveX].Solvers.Add((action) =>
                                                                           GlobalElementStatus.Position.X += action.Offset * Canvas.Size.Width
                                                                           );

            tempSolver.AxisInputAction[GuiProperty.InputMoveY].Solvers.Add((action) =>
                                                                           GlobalElementStatus.Position.Y += action.Offset * Canvas.Size.Height
                                                                           );

            tempSolver.InputMappeds.Add(InputMapped);

            foreach (var action in actions)
            {
                tempSolver.Execute(action);

                foreach (var group in Groups)
                {
                    group.Value.Input(action);
                }
            }
        }
Beispiel #2
0
 public static void Execute(InputSolver solver)
 {
     //execute input solver without remove input actions
     foreach (var inputAction in mInputQueue)
     {
         solver.Execute(inputAction);
     }
 }
Beispiel #3
0
        protected internal override void Input(InputAction action)
        {
            //for char input action, we need to skip the mapped test
            if (action.Type == InputType.Char)
            {
                InputSolver.CharInputAction[GuiProperty.InputText].ForEach(action as CharInputAction);
            }

            var alias = InputMapped.IsMapped(action.Name) ?
                        InputMapped.MappedInput(action.Name) : Gui.InputMapped.MappedInput(action.Name);

            if (!GuiProperty.IsGuiInput(alias))
            {
                return;
            }

            InputSolver.Execute(action);
        }