feat(beatmap): implement get beatmap arrtibutes
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from enum import Enum, IntEnum
|
||||
from typing import Any, TypedDict
|
||||
|
||||
import rosu_pp_py as rosu
|
||||
|
||||
|
||||
class GameMode(str, Enum):
|
||||
@@ -10,6 +11,14 @@ class GameMode(str, Enum):
|
||||
FRUITS = "fruits"
|
||||
MANIA = "mania"
|
||||
|
||||
def to_rosu(self) -> rosu.GameMode:
|
||||
return {
|
||||
GameMode.OSU: rosu.GameMode.Osu,
|
||||
GameMode.TAIKO: rosu.GameMode.Taiko,
|
||||
GameMode.FRUITS: rosu.GameMode.Catch,
|
||||
GameMode.MANIA: rosu.GameMode.Mania,
|
||||
}[self]
|
||||
|
||||
|
||||
MODE_TO_INT = {
|
||||
GameMode.OSU: 0,
|
||||
@@ -32,11 +41,6 @@ class Rank(str, Enum):
|
||||
F = "f"
|
||||
|
||||
|
||||
class APIMod(TypedDict):
|
||||
acronym: str
|
||||
settings: dict[str, Any]
|
||||
|
||||
|
||||
# https://github.com/ppy/osu/blob/master/osu.Game/Rulesets/Scoring/HitResult.cs
|
||||
class HitResult(IntEnum):
|
||||
PERFECT = 0 # [Order(0)]
|
||||
|
||||
Reference in New Issue
Block a user