Files
mbEditorPro/mbEditorPro2.0/arcane/objects/ArcDungeonUnitObject.py
T

43 lines
1.9 KiB
Python
Raw Normal View History

2022-12-25 08:47:00 -05:00
# • ▌ ▄ ·. ▄▄▄▄· ▄▄▄ .·▄▄▄▄ ▪ ▄▄▄▄▄ ▄▄▄ ▄▄▄·▄▄▄
# ·██ ▐███▪▐█ ▀█▪ ▀▄.▀·██▪ ██ ██ •██ ▪ ▀▄ █· ▐█ ▄█▀▄ █·▪
# ▐█ ▌▐▌▐█·▐█▀▀█▄ ▐▀▀▪▄▐█· ▐█▌▐█· ▐█.▪ ▄█▀▄ ▐▀▀▄ ██▀·▐▀▀▄ ▄█▀▄
# ██ ██▌▐█▌██▄▪▐█ ▐█▄▄▌██. ██ ▐█▌ ▐█▌·▐█▌.▐▌▐█•█▌ ▐█▪·•▐█•█▌▐█▌.▐▌
# ▀▀ █▪▀▀▀·▀▀▀▀ ▀▀▀ ▀▀▀▀▀• ▀▀▀ ▀▀▀ ▀█▄▀▪.▀ ▀ .▀ .▀ ▀ ▀█▄▀▪
# Magicbane Emulator Project © 2013 - 2022
# www.magicbane.com
2022-10-10 13:06:07 -04:00
from arcane.util.ResStream import ResStream
from .ArcStructureObject import ArcStructureObject
class ArcDungeonUnitObject(ArcStructureObject):
def load_binary(self, stream: ResStream):
super().load_binary(stream)
num_connectables = stream.read_dword()
self.dungeon_connectable_edges = [
2026-10-16 12:55:04 -04:00
stream.read_long() for _ in range(num_connectables)
2022-10-10 13:06:07 -04:00
]
def save_binary(self, stream: ResStream):
super().save_binary(stream)
stream.write_dword(len(self.dungeon_connectable_edges))
for edge in self.dungeon_connectable_edges:
2026-10-16 12:55:04 -04:00
stream.write_long(edge)
2022-10-10 13:06:07 -04:00
def load_json(self, data):
super().load_json(data)
self.dungeon_connectable_edges = data['dungeon_connectable_edges']
return data
def save_json(self):
data = super().save_json()
data['dungeon_connectable_edges'] = self.dungeon_connectable_edges
return data
class ArcDungeonExitObject(ArcDungeonUnitObject):
pass
class ArcDungeonStairObject(ArcDungeonUnitObject):
pass