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