Repository for mbEditorPro 2.0
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.

34 lines
1.8 KiB

# • ▌ ▄ ·. ▄▄▄▄· ▄▄▄ .·▄▄▄▄ ▪ ▄▄▄▄▄ ▄▄▄ ▄▄▄·▄▄▄
# ·██ ▐███▪▐█ ▀█▪ ▀▄.▀·██▪ ██ ██ •██ ▪ ▀▄ █· ▐█ ▄█▀▄ █·▪
# ▐█ ▌▐▌▐█·▐█▀▀█▄ ▐▀▀▪▄▐█· ▐█▌▐█· ▐█.▪ ▄█▀▄ ▐▀▀▄ ██▀·▐▀▀▄ ▄█▀▄
# ██ ██▌▐█▌██▄▪▐█ ▐█▄▄▌██. ██ ▐█▌ ▐█▌·▐█▌.▐▌▐█•█▌ ▐█▪·•▐█•█▌▐█▌.▐▌
# ▀▀ █▪▀▀▀·▀▀▀▀ ▀▀▀ ▀▀▀▀▀• ▀▀▀ ▀▀▀ ▀█▄▀▪.▀ ▀ .▀ .▀ ▀ ▀█▄▀▪
# Magicbane Emulator Project © 2013 - 2022
# www.magicbane.com
from arcane.util import ResStream
from .MobileInfo import MobileInfo
class TrainerInfo(MobileInfo):
def load_binary(self, stream: ResStream):
super().load_binary(stream)
self.trainer_std_profit_margin = stream.read_float()
self.trainer_profit_margin = stream.read_float()
def save_binary(self, stream: ResStream):
super().save_binary(stream)
stream.write_float(self.trainer_std_profit_margin)
stream.write_float(self.trainer_profit_margin)
def save_json(self):
data = super().save_json()
data['trainer_std_profit_margin'] = self.trainer_std_profit_margin
data['trainer_profit_margin'] = self.trainer_profit_margin
return data
def load_json(self, data):
super().load_json(data)
self.trainer_std_profit_margin = data['trainer_std_profit_margin']
self.trainer_profit_margin = data['trainer_profit_margin']