I'll preface this by saying that this may just be me being naive, and this might not fit with the framework, so sorry if that's the case.
I'm trying to write a re-usable input class, which has Actions, which represent the inputs.
public class Action
{
public Keys key { get; set; } = Keys.None;
public Buttons button { get; set; } = Buttons.None;
public MouseButtons mousebutton { get; set; } = MouseButtons.None;
}
In some cases, you might want a keyboard only, or mouse only action. The problem is, Buttons.None doesn't exist. (MouseButtons was simple enough to make, though, so that's not a problem.) I could make Buttons nullable, and I think that would work, but doesn't feel like the most consistent choice.
I read in another issue that when polling for controller input, you'll never get the value None, which is a problem, I suppose. Adding it just for some edge cases may not be the best choice, but it also seems fairly consistent. Why would their only be Keys.None, and not Buttons.None.
I'll preface this by saying that this may just be me being naive, and this might not fit with the framework, so sorry if that's the case.
I'm trying to write a re-usable input class, which has Actions, which represent the inputs.
public class Action
{
public Keys key { get; set; } = Keys.None;
public Buttons button { get; set; } = Buttons.None;
public MouseButtons mousebutton { get; set; } = MouseButtons.None;
}
In some cases, you might want a keyboard only, or mouse only action. The problem is, Buttons.None doesn't exist. (MouseButtons was simple enough to make, though, so that's not a problem.) I could make Buttons nullable, and I think that would work, but doesn't feel like the most consistent choice.
I read in another issue that when polling for controller input, you'll never get the value None, which is a problem, I suppose. Adding it just for some edge cases may not be the best choice, but it also seems fairly consistent. Why would their only be Keys.None, and not Buttons.None.