Closed davidjha closed 4 years ago
I do not know how useful this is but when I had our adjudicator saving to an excel sheet, I had a function outside of base.py that returned a list of all the data we wanted to store. Basically, I made a function in the state that returned a list of important values and the game manager looped through the stored states and had each of them call that function to get that data to store.
Alright thanks! I think I remember seeing that somewhere, I'll take a look.
Hearts and database specific processing has been moved out of the game manager and its save_game() method. The game manager now calls a method in state.py: save_state(player_action) and caches the state data into a list: state_data. At the end of the game, play_hearts.py calls save_game() which returns this list. Play_hearts.py now does the processing of the data to store into the database. mysql-on-argo branch as been updated with the changes.
Description
The project could derive game specific game managers, however the only thing that really differentiates the derived game managers would be in the save_game() method. Currently, the save_game() method in GameManager (base.py) is tailored towards Hearts or other games of that kind.
Possible solutions is to move save_game() out of GameManager. Another possible solution is to have save_game() serve as a dummy method which can then call a more game specific save_game(game_type).