Files
neonsr/game_server/resource/decorators.py
Naruse ec8972d5d6 init
2025-04-15 19:36:05 +08:00

18 lines
355 B
Python

from typing import Type, Dict
resource_registry: Dict[Type, Dict[str, any]] = {}
class LoadPriority:
HIGH = 1
NORMAL = 2
LOW = 3
def GameResource(path: str, load_priority=LoadPriority.NORMAL):
def decorator(cls):
resource_registry[cls] = {"path": path, "load_priority": load_priority}
return cls
return decorator