MibooGram/modules/wiki/models/enums.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

55 lines
969 B
Python
Raw Normal View History

from enum import Enum, IntEnum
class ZZZElementType(IntEnum):
"""ZZZ element type."""
NULL = 1
""""""
PHYSICAL = 200
""" 物理 """
FIRE = 201
""""""
ICE = 202
""""""
ELECTRIC = 203
""""""
ETHER = 205
""" 以太 """
class ZZZSpeciality(IntEnum):
"""ZZZ agent compatible speciality."""
ATTACK = 1
""" 强攻 """
STUN = 2
""" 击破 """
ANOMALY = 3
""" 异常 """
SUPPORT = 4
""" 支援 """
DEFENSE = 5
""" 防护 """
class ZZZRank(str, Enum):
"""ZZZ Rank"""
S = "S"
A = "A"
B = "B"
C = "C"
D = "D"
NULL = "NULL"
@property
def int(self):
value_map = {"S": 5, "A": 4, "B": 3, "C": 2, "D": 1, "NULL": 0}
return value_map[self.value]
2024-08-16 03:39:47 +00:00
@staticmethod
def get_rank(value: int):
value_map = {5: "S", 4: "A", 3: "B", 2: "C", 1: "D", 0: "NULL"}
return ZZZRank(value_map[value])