summaryrefslogtreecommitdiff
path: root/swiftstory/game_manager.py
AgeCommit message (Collapse)Author
2021-12-27Remove unnecessary module importsOlivier Gayot
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2021-12-26Make cards be part of the Python package dataOlivier Gayot
We now load the cards using pkg_resources. This is way better in many aspects: * we can install the package using pip without having issues loading cards * we don't need to chdir to / before running swiftstoryd * we don't need to rely on data_files which is deprecated. Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2021-12-23Refactor GameManager and add control over game creationOlivier Gayot
GameManager had a method called join_game ; which was not actually doing any joining. Instead, it was just returning a reference to the game that would match the specified game name and language. In case the game would not exist, it would be created before being returned. The function is now renamed find_by_name. Also a new parameter "create" has been added. It is a boolean that controls whether a game would be created if it does not exist. Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2021-12-23Move FS operation outside the initializer of GameManagerOlivier Gayot
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2021-12-23Use a language container rather than a dictionaryOlivier Gayot
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2021-12-23Add required annotations to make sure mypy succeedsOlivier Gayot
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2021-12-23Use lowercase module namesOlivier Gayot
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>