StarRailCopilot/tasks/battle_pass/keywords/classes.py
2024-01-02 00:43:34 +08:00

36 lines
721 B
Python

import re
from dataclasses import dataclass
from typing import ClassVar
from module.ocr.keyword import Keyword
@dataclass(repr=False)
class BattlePassTab(Keyword):
instances: ClassVar = {}
@dataclass(repr=False)
class BattlePassMissionTab(Keyword):
instances: ClassVar = {}
@dataclass(repr=False)
class BattlePassQuest(Keyword):
instances: ClassVar = {}
@classmethod
def _compare(cls, name, keyword):
def remove_digit(text):
return re.sub(r"\d", "", text)
return remove_digit(name) == remove_digit(keyword)
def __hash__(self) -> int:
return super().__hash__()
@dataclass(repr=False)
class BattlePassQuestState(Keyword):
instances: ClassVar = {}