Files
KianaBH3/game_server/resource/base_resource.py
2024-11-07 23:25:15 +08:00

16 lines
374 B
Python

from abc import ABC, abstractmethod
from dataclasses import dataclass
from typing import TypeVar
T = TypeVar("T", bound="BaseResource")
@dataclass
class BaseResource(ABC):
def on_load(self: T) -> bool:
"""returns True by default if item loaded, otherwise will be skipped"""
return True
@abstractmethod
def get_index(self) -> str:
pass