MCPcopy Create free account
hub / github.com/asottile/nintendo-microcontrollers / Point

Class Point

scripts/engine.py:87–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85
86
87class Point(NamedTuple):
88 y: int
89 x: int
90
91 def norm(self, dims: tuple[int, int, int]) -> Point:
92 return type(self)(
93 int(self.y / NORM.y * dims[0]),
94 int(self.x / NORM.x * dims[1]),
95 )
96
97 def denorm(self, dims: tuple[int, int, int]) -> Point:
98 return type(self)(
99 int(self.y / dims[0] * NORM.y),
100 int(self.x / dims[1] * NORM.x),
101 )
102
103
104NORM = Point(y=720, x=1280)

Callers 15

switch.pyFile · 0.90
__init__Method · 0.90
clockFunction · 0.90
mainFunction · 0.90
cbFunction · 0.90
mainFunction · 0.90
battleFunction · 0.90
is_birdFunction · 0.90
mainFunction · 0.90
std_cm.pyFile · 0.90
is_birdFunction · 0.90
mainFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected