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