Update save.py
This commit is contained in:
parent
3e9cd33e98
commit
8d58c9647a
1 changed files with 3 additions and 3 deletions
|
@ -2,8 +2,8 @@ from os import path
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
class SaveManager: # manages save and configuration files
|
class SaveManager: # manages save and configuration files
|
||||||
def __init__(self,id:str):
|
def __init__(self,gid:str):
|
||||||
self.id = id # game ID
|
self.id = gid # game ID
|
||||||
self.currentPrompt = "" # Current prompt
|
self.currentPrompt = "" # Current prompt
|
||||||
self.inventory = [] # Items in inventory
|
self.inventory = [] # Items in inventory
|
||||||
|
|
||||||
|
@ -19,4 +19,4 @@ class SaveManager: # manages save and configuration files
|
||||||
def save(self):
|
def save(self):
|
||||||
data = {"id":self.id,"currentPrompt":self.currentPrompt,"inventory":self.inventory}
|
data = {"id":self.id,"currentPrompt":self.currentPrompt,"inventory":self.inventory}
|
||||||
with open(f"./saves/{self.id}.yml",mode="w",encoding="utf-8") as f:
|
with open(f"./saves/{self.id}.yml",mode="w",encoding="utf-8") as f:
|
||||||
yaml.dump(data,f)
|
yaml.dump(data,f)
|
||||||
|
|
Reference in a new issue