예제 #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);
                }
            }
        }
예제 #2
0
 public static void Execute(InputSolver solver)
 {
     //execute input solver without remove input actions
     foreach (var inputAction in mInputQueue)
     {
         solver.Execute(inputAction);
     }
 }
예제 #3
0
        public GuiGroup(string name)
        {
            Name        = name;
            Elements    = new List <GuiElement>();
            InputMapped = new InputMapped();
            InputSolver = new InputSolver();

            InitializeInputSolver();
        }
예제 #4
0
        public int Push(InputSolver solver)
        {
            var newSolver = mInputSolvers.Count != 0 ? new InputSolver(mInputSolvers.Peek()) : new InputSolver();

            newSolver.Override(solver);

            mInputSolvers.Push(newSolver);

            return(mInputSolvers.Count - 1);
        }
예제 #5
0
        public void Override(InputSolver other)
        {
            foreach (var action in other.ButtonInputAction)
            {
                ButtonInputAction[action.Key] = action.Value;
            }
            foreach (var action in other.AxisInputAction)
            {
                AxisInputAction[action.Key] = action.Value;
            }
            foreach (var action in other.CharInputAction)
            {
                CharInputAction[action.Key] = action.Value;
            }

            InputMappeds.InsertRange(0, other.InputMappeds);
        }
예제 #6
0
 public InputSolver(InputSolver other) : base() =>