Esempio n. 1
0
 internal void Trigger(CommonUserCommand command, UserCommandArgs commandArgs, GameTime gameTime, KeyModifiers modifier = KeyModifiers.None)
 {
     for (int i = 0; i < (layeredControllers?.Count ?? 0); i++)
     {
         layeredControllers[i].Trigger(command, commandArgs, gameTime, modifier);
         if (commandArgs.Handled)
         {
             return;
         }
     }
     commonUserCommandsArgs[command]?.Invoke(commandArgs, gameTime, modifier);
 }
Esempio n. 2
0
 internal void Trigger(CommonUserCommand command, UserCommandArgs commandArgs, GameTime gameTime, KeyModifiers modifier = KeyModifiers.None)
 {
     commonUserCommandsArgs[command]?.Invoke(commandArgs, gameTime, modifier);
 }
Esempio n. 3
0
        public void RemoveEvent(CommonUserCommand userCommand, Action <UserCommandArgs, KeyModifiers> action)
        {
            Action <UserCommandArgs, GameTime, KeyModifiers> command = DelegateConverter.ConvertDelegate <Action <UserCommandArgs, KeyModifiers>, Action <UserCommandArgs, GameTime, KeyModifiers> >(action, new int[] { 0, 2 });

            commonUserCommandsArgs[userCommand] -= command;
        }
Esempio n. 4
0
 public void RemoveEvent(CommonUserCommand userCommand, Action <UserCommandArgs, GameTime, KeyModifiers> action)
 {
     commonUserCommandsArgs[userCommand] -= action;
 }
Esempio n. 5
0
        public void AddEvent(CommonUserCommand userCommand, Action <UserCommandArgs> action)
        {
            Action <UserCommandArgs, GameTime, KeyModifiers> command = DelegateConverter.ConvertDelegate <Action <UserCommandArgs>, Action <UserCommandArgs, GameTime, KeyModifiers> >(action);

            commonUserCommandsArgs[userCommand] += command;
        }