From ddf77ef16215ea39fbb82437fc6afbfa21184df1 Mon Sep 17 00:00:00 2001 From: xtaodada Date: Sat, 30 Sep 2023 23:01:24 +0800 Subject: [PATCH] :alien: Move copper_man from activity to resident --- simnet/models/starrail/chronicle/activity.py | 56 ------------------- simnet/models/starrail/chronicle/resident.py | 57 ++++++++++++++++++++ 2 files changed, 57 insertions(+), 56 deletions(-) diff --git a/simnet/models/starrail/chronicle/activity.py b/simnet/models/starrail/chronicle/activity.py index 1d03656..0773f3c 100644 --- a/simnet/models/starrail/chronicle/activity.py +++ b/simnet/models/starrail/chronicle/activity.py @@ -83,57 +83,6 @@ class StarRailTreasureDungeon(StarRailActivityBase): records: List[StarRailTreasureDungeonRecord] -class StarRailCopperManInfoBasic(APIModel): - """Copper Man Info Basic""" - - level: int - accumulate: int - cur_common_order: int - max_common_order: int - cur_customer_order: int - max_customer_order: int - cur_alley_event: int - max_alley_event: int - - @property - def common_order_process(self) -> float: - """Get the common order process.""" - return 100.0 * self.cur_common_order / self.max_common_order - - @property - def customer_order_process(self) -> float: - """Get the customer order process.""" - return 100.0 * self.cur_customer_order / self.max_customer_order - - @property - def alley_event_process(self) -> float: - """Get the alley event process.""" - return 100.0 * self.cur_alley_event / self.max_alley_event - - -class StarRailCopperManInfoShop(APIModel): - """Copper Man Info Shop""" - - id: int - icon: str - name: str - is_unlock: bool - - -class StarRailCopperManInfo(APIModel): - """Copper Man Info""" - - basic: StarRailCopperManInfoBasic - shops: List[StarRailCopperManInfoShop] - exists_data: bool - - -class StarRailCopperMan(StarRailActivityBase): - """Copper Man""" - - info: StarRailCopperManInfo - - class StarRailActivity(APIModel): """Starrail chronicle activity.""" @@ -155,8 +104,3 @@ class StarRailActivity(APIModel): def treasure_dungeon(self) -> StarRailTreasureDungeon: """Get the treasure dungeon activity.""" return StarRailTreasureDungeon(**self.find_activity("treasure_dungeon")) - - @property - def copper_man(self) -> StarRailCopperMan: - """Get the copper man activity.""" - return StarRailCopperMan(**self.find_activity("copper_man")) diff --git a/simnet/models/starrail/chronicle/resident.py b/simnet/models/starrail/chronicle/resident.py index a88c2a5..3b8103a 100644 --- a/simnet/models/starrail/chronicle/resident.py +++ b/simnet/models/starrail/chronicle/resident.py @@ -45,6 +45,58 @@ class StarRailResidentMuseum(APIModel): museum: StarRailResidentMuseumInfo +class StarRailCopperManInfoBasic(APIModel): + """Copper Man Info Basic""" + + level: int + accumulate: int + cur_common_order: int + max_common_order: int + cur_customer_order: int + max_customer_order: int + cur_alley_event: int + max_alley_event: int + + @property + def common_order_process(self) -> float: + """Get the common order process.""" + return 100.0 * self.cur_common_order / self.max_common_order + + @property + def customer_order_process(self) -> float: + """Get the customer order process.""" + return 100.0 * self.cur_customer_order / self.max_customer_order + + @property + def alley_event_process(self) -> float: + """Get the alley event process.""" + return 100.0 * self.cur_alley_event / self.max_alley_event + + +class StarRailCopperManInfoShop(APIModel): + """Copper Man Info Shop""" + + id: int + icon: str + name: str + is_unlock: bool + + +class StarRailCopperManInfo(APIModel): + """Copper Man Info""" + + basic: StarRailCopperManInfoBasic + shops: List[StarRailCopperManInfoShop] + exists_data: bool + + +class StarRailCopperMan(APIModel): + """Copper Man""" + + base: StarRailResidentBase + info: StarRailCopperManInfo + + class StarRailResident(APIModel): """Starrail chronicle resident activity.""" @@ -66,3 +118,8 @@ class StarRailResident(APIModel): def boxing(self) -> StarRailResidentBoxing: """Get the boxing resident.""" return StarRailResidentBoxing(**self.find_resident("boxing")) + + @property + def copper_man(self) -> StarRailCopperMan: + """Get the copper man activity.""" + return StarRailCopperMan(**self.find_resident("copper_man"))