示例#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);
 }
示例#2
0
 internal void Trigger(CommonUserCommand command, UserCommandArgs commandArgs, GameTime gameTime, KeyModifiers modifier = KeyModifiers.None)
 {
     commonUserCommandsArgs[command]?.Invoke(commandArgs, gameTime, modifier);
 }
示例#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;
        }
示例#4
0
 public void RemoveEvent(CommonUserCommand userCommand, Action <UserCommandArgs, GameTime, KeyModifiers> action)
 {
     commonUserCommandsArgs[userCommand] -= action;
 }
示例#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;
        }