Big changes here. All states are now 'plugins'. Works well except game icons are missing (this can be fixed later, if we move resources to each plugin). I believe the next logical step would be to move resources into each plugin folder.
Other changes were made to make this happen:
Moved 'State' and 'Control' to own modules
Control module now manages the stats (not title screen)
Gave each state class attribute called 'name'; its used for display and specifying next state
Control is now main source of states/plugins
States are no longer instanced when loaded, they are instanced when used
Moved scene template do design/
Lobby no longer loads scenes/states
Lobby will query Control for all state, chooses states with class attribute "show_in_lobby"
Casino Stats no longer contains refs to all states
Casino Stats will query Control for all states, chooses states with "initialize_stats"
There may be some new bugs related to state instancing. Before states were instanced before being used, and if the state relies on that behavior, it may not function correctly now.
Concerns:
Bugs related to states now being instanced on use (see above)
States hold refs to previous states. This prevents them from being GC'd
Resources should be moved to each plugin/state
We are using terms 'scene' 'state' and 'plugin'. Let's pick one and stick with it.
Some states re-implement state flipping behavior to give 'sub states' (blackjack, atm...) If possible, this should be changed to allowing the Control to change all states.
I also cleaned up a ton of unused imports and did some minor PEP 8 edits (mostly linting).
Removed pymunk as it is installable via PIP.
Big changes here. All states are now 'plugins'. Works well except game icons are missing (this can be fixed later, if we move resources to each plugin). I believe the next logical step would be to move resources into each plugin folder.
Other changes were made to make this happen:
There may be some new bugs related to state instancing. Before states were instanced before being used, and if the state relies on that behavior, it may not function correctly now.
Concerns:
I also cleaned up a ton of unused imports and did some minor PEP 8 edits (mostly linting). Removed pymunk as it is installable via PIP.