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

Refactor global state #5

Closed
newmanrs opened this issue Jan 2, 2022 · 1 comment
Closed

Refactor global state #5

newmanrs opened this issue Jan 2, 2022 · 1 comment
Assignees

Comments

@newmanrs
Copy link
Owner

newmanrs commented Jan 2, 2022

Having the stack in a module is not the only state that needs access and mutation from the calculator actions, as well as roll-back upon crash.

Create a "State" class that also contains verbose/not verbose modes, toggles for clearing the stack (or not) after commands, and move the stored values into this class as well.

This would also be a good time to store a history of the most recent few actions so that they can be repeated, something akin to rpncalc d4 10 repeat_n to roll 4-sided dice 10 times.

@newmanrs
Copy link
Owner Author

e4f4b7e closes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant