2023-07-24 10:15:22 +00:00
|
|
|
from dataclasses import dataclass
|
|
|
|
from typing import ClassVar
|
|
|
|
|
2023-11-10 13:36:53 +00:00
|
|
|
from module.base.decorator import cached_property
|
2023-07-24 10:15:22 +00:00
|
|
|
from module.ocr.keyword import Keyword
|
|
|
|
|
2023-11-10 13:36:53 +00:00
|
|
|
|
2023-07-24 10:15:22 +00:00
|
|
|
@dataclass(repr=False)
|
|
|
|
class CharacterList(Keyword):
|
2023-11-10 13:36:53 +00:00
|
|
|
instances: ClassVar = {}
|
|
|
|
|
2023-12-20 16:15:46 +00:00
|
|
|
def __hash__(self) -> int:
|
|
|
|
return super().__hash__()
|
|
|
|
|
2023-11-10 13:36:53 +00:00
|
|
|
@cached_property
|
|
|
|
def is_trailblazer(self) -> bool:
|
|
|
|
return 'Trailblazer' in self.name
|
2023-11-10 15:35:53 +00:00
|
|
|
|
2023-12-20 16:15:46 +00:00
|
|
|
@cached_property
|
|
|
|
def height(self) -> str:
|
|
|
|
"""
|
|
|
|
Returns:
|
|
|
|
str: Character height, from list ['Kid', 'Girl', 'Boy', 'Maid', 'Miss', 'Lady', 'Lad', 'Male']
|
|
|
|
or 'Unknown' if no data
|
|
|
|
"""
|
|
|
|
from tasks.character.keywords.height import CHARACTER_HEIGHT
|
|
|
|
return CHARACTER_HEIGHT.get(self.name, 'Unknown')
|
2024-02-06 20:33:12 +00:00
|
|
|
|
|
|
|
|
|
|
|
@dataclass(repr=False)
|
|
|
|
class CombatType(Keyword):
|
|
|
|
instances: ClassVar = {}
|
|
|
|
|
|
|
|
def __hash__(self) -> int:
|
|
|
|
return super().__hash__()
|