state sync; the basic early game works

This commit is contained in:
2025-08-05 17:57:43 -07:00
parent 9f514db33b
commit 1b72e899af
16 changed files with 209 additions and 23 deletions

11
app/pylocal/jsonizer.py Normal file
View File

@@ -0,0 +1,11 @@
import json
from . import items
class JSONizer(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, items.TickItem):
return {"resource": obj.resource, "amount": obj.amount, "desc": obj.desc}
else:
# if no encoding here, fall back to stdlib
return super().default(obj)