private Action GetIsChangeStates(IKeyboardController control) { _thingsToDo += IsCapsChange(control); _thingsToDo += IsNumChange(control); _thingsToDo += IsLangChange(control); return(_thingsToDo); }
private Action GetStates(IKeyboardController control) { _thingsToDo += CheckCaps(control); _thingsToDo += CheckNumLock(control); _thingsToDo += CheckLang(control); return(_thingsToDo); }
public void DefineKeyboardControl(IKeyboardController _pool, string controllerId) { var pool = Compatibility.Check <KeyboardController <HommCommand> >(this, _pool); if (controllerId == TwoPlayersId.Left) { pool.Add(Keys.W, () => new HommCommand { Movement = new Movement(Direction.Up) }); pool.Add(Keys.S, () => new HommCommand { Movement = new Movement(Direction.Down) }); pool.Add(Keys.A, () => new HommCommand { Movement = new Movement(Direction.LeftDown) }); pool.Add(Keys.D, () => new HommCommand { Movement = new Movement(Direction.RightDown) }); pool.Add(Keys.Q, () => new HommCommand { Movement = new Movement(Direction.LeftUp) }); pool.Add(Keys.E, () => new HommCommand { Movement = new Movement(Direction.RightUp) }); pool.Add(Keys.Space, () => new HommCommand { Order = new PurchaseOrder(10) }); } else if (controllerId == TwoPlayersId.Right) { pool.Add(Keys.I, () => new HommCommand { Movement = new Movement(Direction.Up) }); pool.Add(Keys.K, () => new HommCommand { Movement = new Movement(Direction.Down) }); pool.Add(Keys.J, () => new HommCommand { Movement = new Movement(Direction.LeftDown) }); pool.Add(Keys.L, () => new HommCommand { Movement = new Movement(Direction.RightDown) }); pool.Add(Keys.U, () => new HommCommand { Movement = new Movement(Direction.LeftUp) }); pool.Add(Keys.O, () => new HommCommand { Movement = new Movement(Direction.RightUp) }); pool.Add(Keys.Enter, () => new HommCommand { Order = new PurchaseOrder(10) }); } pool.StopCommand = () => new HommCommand { Movement = new Wait() }; }
public void DefineKeyboardControl(IKeyboardController _pool, string controllerId) { var pool = Compatibility.Check <KeyboardController <MoveAndGripCommand> >(this, _pool); this.AddGripKeys(pool, controllerId); this.AddSimpleMovementKeys(pool, controllerId); pool.StopCommand = () => new MoveAndGripCommand { SimpleMovement = SimpleMovement.Stand(0.1) }; }
private Action CheckNumLock(IKeyboardController control) { if (IsLocked.IsNumLocked) { NumStatus = true; return(control.NumLockOn); } NumStatus = false; return(control.NumLockOff); }
private Action CheckCaps(IKeyboardController control) { if (IsLocked.IsCapsLocked) { CapsStatus = true; return(control.CapsLockOn); } CapsStatus = false; return(control.CapsLockOff); }
private Action CheckLang(IKeyboardController control) { var currentLayout = KeyboardLayout.GetCurrentKeyboardLayout(); LangStatus = currentLayout; switch (LangStatus) { case "en-US": return(control.SetEng); case "he-IL": return(control.SetHeb); default: return(null); } }
public void Load() { mouse = new MouseController(this); keyboard = new KeyboardController(this); Initialize(); this.EventSubscribe <TimePreUpdateEvent>(e => { foreach (var player in players) { var actions = (List <IInputAction>)player.Actions; foreach (InputAction action in actions) { action.Update(e.DeltaTime); } } Update(); }); }
public void DefineKeyboardControl(IKeyboardController _pool, string controllerId) { var pool = Compatibility.Check <KeyboardController <HommCommand> >(this, _pool); if (controllerId == TwoPlayersId.Left) { pool.Add(Keys.W, () => new HommCommand { Movement = new HexMovement(Direction.Up) }); pool.Add(Keys.S, () => new HommCommand { Movement = new HexMovement(Direction.Down) }); pool.Add(Keys.A, () => new HommCommand { Movement = new HexMovement(Direction.LeftDown) }); pool.Add(Keys.D, () => new HommCommand { Movement = new HexMovement(Direction.RightDown) }); pool.Add(Keys.Q, () => new HommCommand { Movement = new HexMovement(Direction.LeftUp) }); pool.Add(Keys.E, () => new HommCommand { Movement = new HexMovement(Direction.RightUp) }); pool.Add(Keys.Space, () => new HommCommand { HireOrder = new HireOrder(5) }); pool.Add(Keys.X, () => new HommCommand { WaitInGarrison = new Dictionary <UnitType, int> { { UnitType.Militia, 5 } } }); } else if (controllerId == TwoPlayersId.Right) { pool.Add(Keys.I, () => new HommCommand { Movement = new HexMovement(Direction.Up) }); pool.Add(Keys.K, () => new HommCommand { Movement = new HexMovement(Direction.Down) }); pool.Add(Keys.J, () => new HommCommand { Movement = new HexMovement(Direction.LeftDown) }); pool.Add(Keys.L, () => new HommCommand { Movement = new HexMovement(Direction.RightDown) }); pool.Add(Keys.U, () => new HommCommand { Movement = new HexMovement(Direction.LeftUp) }); pool.Add(Keys.O, () => new HommCommand { Movement = new HexMovement(Direction.RightUp) }); pool.Add(Keys.Enter, () => new HommCommand { HireOrder = new HireOrder(5) }); pool.Add(Keys.M, () => new HommCommand { WaitInGarrison = new Dictionary <UnitType, int> { { UnitType.Militia, 5 } } }); } pool.StopCommand = () => new HommCommand { Movement = new HexMovement(waitDuration: 0.1) }; }
private Action IsCapsChange(IKeyboardController control) { return(CapsStatus == IsLocked.IsCapsLocked ? null : CheckCaps(control)); }
private static Action StartTimeAnimation(IKeyboardController control) { return(control.TimeAnimation); }
private static Action StartClearCustom(IKeyboardController control) { return(control.ClearCustom); }
private static Action StartBaseSet(IKeyboardController control) { return(control.SetBase); }
private static Action StartSecondAnimation(IKeyboardController control) { return(control.SecondAnimation); }
private static Action StartFirstAnimation(IKeyboardController control) { return(control.FirstAnimation); }
public OpenTaskManagerCommand(IKeyboardController keyboardController) { this.keyboardController = keyboardController; }
private Action IsNumChange(IKeyboardController control) { return(NumStatus == IsLocked.IsNumLocked ? null : CheckNumLock(control)); }
private Action IsLangChange(IKeyboardController control) { return(LangStatus == KeyboardLayout.GetCurrentKeyboardLayout() ? null : CheckLang(control)); }
public void DefineKeyboardControl(IKeyboardController _pool, string controllerId) { var pool = Compatibility.Check <KeyboardController <PudgeCommand> >(this, _pool); if (controllerId == TwoPlayersId.Left) { pool.Add(Keys.W, () => new PudgeCommand { GameMovement = new GameMovement { Range = keyboardMovementRange } }); pool.Add(Keys.A, () => new PudgeCommand { GameMovement = new GameMovement { Angle = keyboardRotationAngle } }); pool.Add(Keys.D, () => new PudgeCommand { GameMovement = new GameMovement { Angle = -keyboardRotationAngle } }); pool.Add(Keys.Space, () => new PudgeCommand { MakeHook = true }); pool.Add(Keys.F, () => new PudgeCommand { MakeDagger = true, DaggerDestination = new DaggerDestinationPoint(0, 0) }); pool.Add(Keys.G, () => new PudgeCommand { MakeWard = true }); } else { pool.Add(Keys.I, () => new PudgeCommand { GameMovement = new GameMovement { Range = MovementRange } }); pool.Add(Keys.J, () => new PudgeCommand { GameMovement = new GameMovement { Angle = keyboardRotationAngle } }); pool.Add(Keys.L, () => new PudgeCommand { GameMovement = new GameMovement { Angle = -keyboardRotationAngle } }); pool.Add(Keys.Enter, () => new PudgeCommand { MakeHook = true }); } pool.StopCommand = () => new PudgeCommand { GameMovement = new GameMovement { WaitTime = WaitDuration } }; }
public void DefineKeyboardControl(IKeyboardController keyboardController, string controllerId) { }