You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.9 KiB
44 lines
1.9 KiB
2 years ago
|
# • ▌ ▄ ·. ▄▄▄▄· ▄▄▄ .·▄▄▄▄ ▪ ▄▄▄▄▄ ▄▄▄ ▄▄▄·▄▄▄
|
||
|
# ·██ ▐███▪▐█ ▀█▪ ▀▄.▀·██▪ ██ ██ •██ ▪ ▀▄ █· ▐█ ▄█▀▄ █·▪
|
||
|
# ▐█ ▌▐▌▐█·▐█▀▀█▄ ▐▀▀▪▄▐█· ▐█▌▐█· ▐█.▪ ▄█▀▄ ▐▀▀▄ ██▀·▐▀▀▄ ▄█▀▄
|
||
|
# ██ ██▌▐█▌██▄▪▐█ ▐█▄▄▌██. ██ ▐█▌ ▐█▌·▐█▌.▐▌▐█•█▌ ▐█▪·•▐█•█▌▐█▌.▐▌
|
||
|
# ▀▀ █▪▀▀▀·▀▀▀▀ ▀▀▀ ▀▀▀▀▀• ▀▀▀ ▀▀▀ ▀█▄▀▪.▀ ▀ .▀ .▀ ▀ ▀█▄▀▪
|
||
|
# Magicbane Emulator Project © 2013 - 2022
|
||
|
# www.magicbane.com
|
||
2 years ago
|
|
||
|
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 = [
|
||
|
stream.read_dword() for _ in range(num_connectables)
|
||
|
]
|
||
|
|
||
|
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:
|
||
|
stream.write_dword(edge)
|
||
|
|
||
|
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
|