def __init__(self, stream: InputStream): self.contents = stream.get_u8() self.shop_graphic = (self.contents >> 4) & 0x0f self.shop_data_length = self.contents & 0x0f self.unused = [] for unused in range(3): self.unused.append(stream.get_u8()) self.pointer = stream.get_u32()
def read(stream: InputStream): chest_data = stream.get_u32() if chest_data & 0x80000000 == 0: return MoneyChest(chest_data) else: return ItemChest(chest_data)