bjones3 / webMinigame

Webgame built with pure Javascript and Python http://www.gardensim.club/
0 stars 0 forks source link

Change python game_state structure to a class #72

Closed phblj closed 7 years ago

phblj commented 7 years ago

Right now game_state is a dict with lots of helper functions. It's a prime candidate to become a class, and those helper functions will become methods.


Implementation:

create a class GameState(object). It should have the following methods:

The dict storing the data should be private to the class (self._data = {...})

Existing code should be refactored to no longer need direct dict access.

phblj commented 7 years ago

You'll find this issue slightly easier (and will be able to take in a password in the load function) if you merge PR #74 before you start working on it.