Change how serialize.py is imported in levels.py.
This commit is contained in:
parent
536a8e1019
commit
31e1324fc0
@ -1,7 +1,8 @@
|
|||||||
from os import makedirs
|
from os import makedirs
|
||||||
from time import time
|
from time import time
|
||||||
import json
|
import json
|
||||||
from serialize import default, object_hook
|
#from serialize import default, object_hook
|
||||||
|
import serialize
|
||||||
from numba import jit, c16, b1, byte
|
from numba import jit, c16, b1, byte
|
||||||
from numba.experimental import jitclass
|
from numba.experimental import jitclass
|
||||||
from numba.types import UniTuple
|
from numba.types import UniTuple
|
||||||
@ -23,7 +24,7 @@ class Segment:
|
|||||||
def save_level(level):
|
def save_level(level):
|
||||||
makedirs("./levels/", exist_ok=True)
|
makedirs("./levels/", exist_ok=True)
|
||||||
|
|
||||||
level_save = json.dumps(level, default=default)
|
level_save = json.dumps(level, default=serialize.default)
|
||||||
|
|
||||||
unix_timestamp = int(time())
|
unix_timestamp = int(time())
|
||||||
filename = f'{unix_timestamp}.json'
|
filename = f'{unix_timestamp}.json'
|
||||||
@ -34,7 +35,7 @@ def save_level(level):
|
|||||||
|
|
||||||
def open_level(path):
|
def open_level(path):
|
||||||
save = open(path, "r")
|
save = open(path, "r")
|
||||||
r = json.loads(save.read(), object_hook=object_hook)
|
r = json.loads(save.read(), object_hook=serialize.object_hook)
|
||||||
save.close()
|
save.close()
|
||||||
return r
|
return r
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user