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

Class Counter

scripts/engine.py:277–299  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

275
276
277class Counter:
278 def __init__(self, n: int = 0) -> None:
279 self.n = 0
280
281 def increment(self, vid: object, ser: object) -> None:
282 self.n += 1
283
284 def decrement(self, vid: object, ser: object) -> None:
285 self.n -= 1
286
287 def set_to(self, n: int) -> Action:
288 def set_to_impl(vid: object, ser: object) -> None:
289 self.n = n
290 return set_to_impl
291
292 def equals(self, n: int) -> Matcher:
293 def equals_impl(frame: object) -> bool:
294 return self.n == n
295 return equals_impl
296
297 @property
298 def zero(self) -> Matcher:
299 return self.equals(0)
300
301
302States = Mapping[str, tuple[tuple[Matcher, Action, str], ...]]

Callers 2

mainFunction · 0.90
mainFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected