public void Execute(InputAction action) { var alias = MappedInput(action.Name); switch (action) { case ButtonInputAction button: if (ButtonInputAction.ContainsKey(alias)) { ButtonInputAction[alias]?.ForEach(button); } break; case AxisInputAction axis: if (AxisInputAction.ContainsKey(alias)) { AxisInputAction[MappedInput(axis.Name)]?.ForEach(axis); } break; case CharInputAction charInput: if (CharInputAction.ContainsKey(alias)) { CharInputAction[MappedInput(charInput.Name)]?.ForEach(charInput); } break; default: throw new Exception("Invalid Input Action."); } }
public void ForEach(CharInputAction action) { Solvers.ForEach((solver) => solver.Invoke(action)); }