Beispiel #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;
 }
Beispiel #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;
 }
Beispiel #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;
 }
Beispiel #4
0
 public void Add(Command command)
 {
     if (commands.Contains(command) == false)
         commands.Add(command);
 }
Beispiel #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;
 }
Beispiel #6
0
 public void Remove(Command command)
 {
     commands.Remove(command);
 }
Beispiel #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;
 }