add env argument for StorageLoader to load correct module and use it when store game history is enabled

This commit is contained in:
2024-05-05 22:12:14 +02:00
parent 10c7f2656c
commit 7dd46dd72b
3 changed files with 12 additions and 3 deletions
+7
View File
@@ -0,0 +1,7 @@
class StorageLoader:
@classmethod
def build(self, selected_storage:str):
storage_module = __import__(f'statestorage.{selected_storage}', fromlist=[selected_storage])
storage_class = getattr(storage_module, selected_storage)
return storage_class