Remove InputStreams
using a subtrait of UserInput
, allowing users to add their own input kinds
#576
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #569.
As discussed there, we store all of the
UserInput
data in a centralized store, and then update these via independent systems.We can work around the limitations of object safety by moving the required methods out into its own trait,
UpdateableInput
. Add some system sets, an associated type for the data to access and we're looking good.Initial progress
Unfortunately, many of our user input types actually represent a configured type: we can't trivially use a single map of "what does the input data look like per type". This crops up in two places:
Our options here are:
&World
instead of&InputStreams
.CentralInputStore
: chords, dpads and processed axislike data will have to reference this and recompute it.IMO Option 2 is the only viable choice here: 1 imposes too much system ordering pain, and 3 simply won't work very well.
To do
InputUpdateSystem
DummyResource
UpdateableUserInput
UpdateableInput
for all of the buttonlikesUpdateableInput
for all of the non-gamepad dual-axislikesUpdateableInput
for the gamepad dual-axislikesInputStreams
withCentralInputStore
InputStreams