mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 11:30:18 +00:00
...
This commit is contained in:
parent
98fe274dc8
commit
2e8448577d
@ -1,13 +1,13 @@
|
|||||||
from linalg import vec2, vec4
|
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_begin(self, other: 'Body'): ...
|
||||||
def on_box2d_contact_end(self, other: 'Body'): ...
|
def on_box2d_contact_end(self, other: 'Body'): ...
|
||||||
def on_box2d_pre_step(self): ...
|
def on_box2d_pre_step(self): ...
|
||||||
def on_box2d_post_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_polygon(self, vertices: list[vec2], color: vec4): ...
|
||||||
def draw_solid_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): ...
|
def draw_circle(self, center: vec2, radius: float, color: vec4): ...
|
||||||
|
Loading…
x
Reference in New Issue
Block a user