Update save.py

This commit is contained in:
Matyáš Caras 2022-04-19 08:26:58 +02:00 committed by GitHub
parent 3e9cd33e98
commit 8d58c9647a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,8 +2,8 @@ from os import path
import yaml
class SaveManager: # manages save and configuration files
def __init__(self,id:str):
self.id = id # game ID
def __init__(self,gid:str):
self.id = gid # game ID
self.currentPrompt = "" # Current prompt
self.inventory = [] # Items in inventory
@ -19,4 +19,4 @@ class SaveManager: # manages save and configuration files
def save(self):
data = {"id":self.id,"currentPrompt":self.currentPrompt,"inventory":self.inventory}
with open(f"./saves/{self.id}.yml",mode="w",encoding="utf-8") as f:
yaml.dump(data,f)
yaml.dump(data,f)