Added peek next in loop type

This commit is contained in:
Choco
2025-05-13 16:53:07 +08:00
parent 2219820e55
commit 47972a4eb5

View File

@@ -38,6 +38,13 @@ class LoopTypeCycle:
self.current = next(self._cycle)
return self.current
def peek_next(self) -> LoopType:
temp_cycle = cycle(LoopType)
while next(temp_cycle) != self.current:
pass
return next(temp_cycle)
def set_mode(self, value: LoopType) -> LoopType:
while next(self._cycle) != value:
pass