I'm having difficulty with providing the interface I want from my library however.
Currently my InputManager has a method that can be used to map an actions to a button(s) with the following header:
public void AddMapping(InputAction action, params Buttons[] buttons)
InputAction is an enum, which is currently defined as follows:
public enum InputAction{ Jump, Use, ...}
So for example the method could be used to map the A and B buttons to the Jump action:
InputManager.AddMapping(InputAction.Jump, Buttons.A, Buttons.B)
This all worked fine when the "engine" was part of the same project as the game, however now that I've seperated the two it causes problems.
I don't want InputAction to be predefined, I want this to be defined by the users (currently only me) of the library so they can have more flexibility.
The problem I'm having is that enums can't be inherited from though, so I can't define InputActions as an "abstract" enum and then have people inherit from it to add their own options.
One option would be to switch to the following, but it doesn't really sit well with me, as it's too generic and doesn't make the intention of the method clear.
public void AddMapping(Enum action, params Buttons[] buttons)
Defining InputActions as an abstract class and then expecting people to inherit use const int Value = 0 etc seems a complete mess to me and it's not obvious how it should be used.
The only other options I can think of is just to have InputAction to be completely generic:
public enum InputAction{ Action1, Action2, ...}
This approach seems to defeat the point of using an enum though, as if I'm going down this route I might as well just use an int to define my actions.
So, is there a better way to present this interface across a library boundary, or am I stuck with picking one of the solutions above?