-
Notifications
You must be signed in to change notification settings - Fork 7
Description
This week I been papering over the RocketClient
with a new simple
API as you may have seen. It's starting to work very well for my upcoming Graffathon entry's engine, but the module has gotten rather complicated, partly due to the current client API design.
I started thinking, what if we make both the "low level" RocketClient
and the RocketPlayer
no longer own the tracks but work on borrowed tracks instead? This would make it easier to keep track state stashed somewhere else but also cleanly represent a "not connected" state by wrapping the client in an Option
.
The design change would also make RocketClient::save_tracks
redundant and we should remove it. It's already named confusingly because it's not saving anything, just borrowing a reference to internal track state.
The function signatures would have to change to take a &Tracks
or &mut Tracks
where needed, and some references to self
could probably also be removed (I'm thinking get_track
mostly).