Mainloop+house
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import json
|
||||
from data.cat import Cat
|
||||
import os
|
||||
|
||||
|
||||
class SaveData:
|
||||
@@ -9,7 +10,9 @@ class SaveData:
|
||||
|
||||
|
||||
def save(cat):
|
||||
with open(f"{cat.name}.kitten", "w") as f:
|
||||
if not os.path.exists("saves"):
|
||||
os.mkdir("saves")
|
||||
with open(f"saves/{cat.name}.kitten", "w") as f:
|
||||
json.dump(cat.to_dict(), f)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user