👽 Move copper_man from activity to resident

This commit is contained in:
xtaodada 2023-09-30 23:01:24 +08:00
parent fae6125ca1
commit ddf77ef162
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659
2 changed files with 57 additions and 56 deletions

View File

@ -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"))

View File

@ -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"))