from typing import TypeVar, Generic, Union, Optional, Protocol, Tuple, List, Any, Self, Callable
from types import TracebackType
from enum import Flag, Enum, auto
from dataclasses import dataclass
from abc import abstractmethod
import weakref
from componentize_py_types import Result, Ok, Err, Some
class Serialize:
def __init__(self) -> None:
raise NotImplementedError
def get_type(self) -> str:
raise NotImplementedError
def __enter__(self) -> Self:
return self
def __exit__(self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None) -> bool | None:
raise NotImplementedError
@dataclass
class Schedule_ModStartup:
pass
@dataclass
class Schedule_PreUpdate:
pass
@dataclass
class Schedule_Update:
pass
@dataclass
class Schedule_PostUpdate:
pass
@dataclass
class Schedule_FixedPreUpdate:
pass
@dataclass
class Schedule_FixedUpdate:
pass
@dataclass
class Schedule_FixedPostUpdate:
pass
@dataclass
class Schedule_Custom:
value: str
Schedule = Union[Schedule_ModStartup, Schedule_PreUpdate, Schedule_Update, Schedule_PostUpdate, Schedule_FixedPreUpdate, Schedule_FixedUpdate, Schedule_FixedPostUpdate, Schedule_Custom]
@dataclass
class QueryFor_Ref:
value: str
@dataclass
class QueryFor_Mut:
value: str
@dataclass
class QueryFor_With:
value: str
@dataclass
class QueryFor_Without:
value: str
QueryFor = Union[QueryFor_Ref, QueryFor_Mut, QueryFor_With, QueryFor_Without]
class System:
def __init__(self, name: str) -> None:
raise NotImplementedError
def add_commands(self) -> None:
raise NotImplementedError
def add_query(self, query: List[QueryFor]) -> None:
raise NotImplementedError
def after(self, other: Self) -> None:
raise NotImplementedError
def before(self, other: Self) -> None:
raise NotImplementedError
def __enter__(self) -> Self:
return self
def __exit__(self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None) -> bool | None:
raise NotImplementedError
class App:
def add_systems(self, schedule: Schedule, systems: List[System]) -> None:
raise NotImplementedError
def __enter__(self) -> Self:
return self
def __exit__(self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None) -> bool | None:
raise NotImplementedError
class Entity:
def __enter__(self) -> Self:
return self
def __exit__(self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None) -> bool | None:
raise NotImplementedError
class EntityCommands:
def id(self) -> Entity:
raise NotImplementedError
def insert(self, bundle: List[Tuple[str, bytes]]) -> None:
raise NotImplementedError
def remove(self, bundle: List[str]) -> None:
raise NotImplementedError
def despawn(self) -> None:
raise NotImplementedError
def try_despawn(self) -> None:
raise NotImplementedError
def __enter__(self) -> Self:
return self
def __exit__(self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None) -> bool | None:
raise NotImplementedError
class Commands:
def spawn_empty(self) -> EntityCommands:
raise NotImplementedError
def spawn(self, bundle: List[Tuple[str, bytes]]) -> EntityCommands:
raise NotImplementedError
def entity(self, entity: Entity) -> EntityCommands:
raise NotImplementedError
def __enter__(self) -> Self:
return self
def __exit__(self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None) -> bool | None:
raise NotImplementedError
class Component:
def get(self) -> bytes:
raise NotImplementedError
def set(self, value: bytes) -> None:
raise NotImplementedError
def invoke(self, method: str, params: bytes) -> bytes:
raise NotImplementedError
def __enter__(self) -> Self:
return self
def __exit__(self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None) -> bool | None:
raise NotImplementedError
class QueryResult:
def entity(self) -> Entity:
raise NotImplementedError
def component(self, index: int) -> Component:
raise NotImplementedError
def __enter__(self) -> Self:
return self
def __exit__(self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None) -> bool | None:
raise NotImplementedError
class Query:
def iter(self) -> Optional[QueryResult]:
raise NotImplementedError
def __enter__(self) -> Self:
return self
def __exit__(self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None) -> bool | None:
raise NotImplementedError