This commit is contained in:
Yohann D'ANELLO
2020-11-18 14:56:59 +01:00
parent be6c949b18
commit 958dcdfee0
5 changed files with 20 additions and 16 deletions

View File

@ -1,7 +1,8 @@
from random import randint
from typing import Any, Optional,Generator
from typing import Any, Optional
import json
import os
import sys
from .entities.player import Player
from .enums import GameMode, KeyValues, DisplayActions
@ -111,18 +112,18 @@ class Game:
elif option == menus.MainMenuValues.EXIT:
sys.exit(0)
def save_state(self) -> dict():
def save_state(self) -> dict:
"""
Saves the game to a dictionnary
Saves the game to a dictionary
"""
return self.map.save_state()
def load_state(self, d: dict) -> None:
"""
Loads the game from a dictionnary
Loads the game from a dictionary
"""
self.map.load_state(d)
def load_game(self) -> None:
"""
Loads the game from a file