Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make run take self instead of &mut self #18

Open
90degs2infty opened this issue Dec 2, 2023 · 0 comments
Open

Make run take self instead of &mut self #18

90degs2infty opened this issue Dec 2, 2023 · 0 comments
Labels
refactoring Improves code quality without touching features

Comments

@90degs2infty
Copy link
Owner

Currently, running a game driver is backed by GameDriver::run(&mut self) -> ....

This has a set of drawbacks:

  • a GameDriver drives exactly one game, therefore lending towards the signature GameDriver::run(self) -> ...
  • it forces us to apply Jone's trick internally to alter the internal state, as we cannot move out the state member when having access to a &mut self

The underlying assumption was that with the self signature, terminating the running driver would be hard/impossible and storing the GameDriver would be hard, too. This is probably not the case when using the Abortable future. Check this.

@90degs2infty 90degs2infty added the refactoring Improves code quality without touching features label Dec 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Improves code quality without touching features
Projects
None yet
Development

No branches or pull requests

1 participant