This commit is contained in:
blueloveTH 2024-01-06 13:41:51 +08:00
parent 98fe274dc8
commit 2e8448577d

View File

@ -1,13 +1,13 @@
from linalg import vec2, vec4
from typing import Iterable
from typing import Iterable, Protocol
class _NodeLike: # duck-type protocol
class _NodeLike(Protocol):
def on_box2d_contact_begin(self, other: 'Body'): ...
def on_box2d_contact_end(self, other: 'Body'): ...
def on_box2d_pre_step(self): ...
def on_box2d_post_step(self): ...
class _DrawLike: # duck-type protocol
class _DrawLike(Protocol):
def draw_polygon(self, vertices: list[vec2], color: vec4): ...
def draw_solid_polygon(self, vertices: list[vec2], color: vec4): ...
def draw_circle(self, center: vec2, radius: float, color: vec4): ...