Example #1
0
 public Command Add(State touchState, Action<Touch> callback)
 {
     var command = new Command();
     command.Callback += trigger => callback(touch);
     command.Add(new TouchPressTrigger(touchState));
     Add(command);
     return command;
 }
Example #2
0
 public Command Add(MouseButton mouseButton, State buttonState, Action<Mouse> callback)
 {
     var command = new Command();
     command.Callback += trigger => callback(mouse);
     command.Add(new MouseButtonTrigger(mouseButton, buttonState));
     Add(command);
     return command;
 }
Example #3
0
 public Command Add(Key key, State keyState, Action callback)
 {
     var command = new Command();
     command.Callback += trigger => callback();
     command.Add(new KeyTrigger(key, keyState));
     Add(command);
     return command;
 }
Example #4
0
 public void Add(Command command)
 {
     if (commands.Contains(command) == false)
         commands.Add(command);
 }
Example #5
0
 public Command Add(GamePadButton gamePadButton, State keyState, Action callback)
 {
     var command = new Command();
     command.Callback += trigger => callback();
     command.Add(new GamePadButtonTrigger(gamePadButton, keyState));
     Add(command);
     return command;
 }
Example #6
0
 public void Remove(Command command)
 {
     commands.Remove(command);
 }
Example #7
0
 public Command AddMouseMovement(Action<Mouse> mouseMovementCallback)
 {
     var command = new Command();
     command.Callback += trigger => mouseMovementCallback(mouse);
     command.Add(new MouseMovementTrigger());
     Add(command);
     return command;
 }