コード例 #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
ファイル: InputCombine.cs プロジェクト: zhiy0122/GalDesigner
        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() =>