p3he/games/cross/__init__.py

18 lines
489 B
Python

import importlib.resources as impr
import sys
import json
import serialize
from engineevents import EngineEvent
def init(aoEngineEvents):
curm = sys.modules[__name__]
files = impr.files(curm)
level = None
with files.joinpath("cross.json").open('r') as leveldir:
level = json.loads(leveldir.read(), object_hook=serialize.object_hook)
aoEngineEvents.append(EngineEvent(
'level',
lambda _: level,
tsArguments=()
))