Grid.set() sets pos to True by default

This commit is contained in:
Stefan Harmuth 2021-12-03 17:01:19 +01:00
parent d0c5e319fb
commit da791d3ec5

View File

@ -47,7 +47,7 @@ class Grid:
self.__trackBoundaries(pos) self.__trackBoundaries(pos)
self.__grid[pos] = not self.__default self.__grid[pos] = not self.__default
def set(self, pos: Coordinate, value: Any): def set(self, pos: Coordinate, value: Any = True):
if value in OFF_STATES and pos in self.__grid: if value in OFF_STATES and pos in self.__grid:
del self.__grid[pos] del self.__grid[pos]
elif value not in OFF_STATES: elif value not in OFF_STATES: