feat(beatmap): implement get beatmap arrtibutes

This commit is contained in:
MingxuanGame
2025-07-26 17:31:23 +00:00
parent ef977d1c2d
commit 900a17f815
16 changed files with 425 additions and 171 deletions

View File

@@ -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)]