StarRailCopilot/tasks/battle_pass/keywords/classes.py
Hengyu 28d5c43602
Add: battle pass recognition (#49)
* Add: battle pass mission recognition

* Fix: typo

* Add: version mission recognition

* Fix: typo

* Upd: remove version mission

* Upd: keep ui of version quest
2023-08-02 19:07:46 +08:00

33 lines
655 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)
@dataclass(repr=False)
class BattlePassQuestState(Keyword):
instances: ClassVar = {}