Beispiel #1
0
 def __getitem__(self, pos: Pos) -> bool:
     R = self.R
     assert pos.is_inside_matrix(R), pos
     return self._data[pos.x * R * R + pos.y * R + pos.z]
Beispiel #2
0
 def __setitem__(self, pos: Pos, value: bool):
     R = self.R
     assert pos.is_inside_matrix(R)
     self._data[pos.x * R * R + pos.y * R + pos.z] = value
Beispiel #3
0
 def _set(self, pos: Pos, value: Cell):
     R = self.R
     assert pos.is_inside_matrix(R)
     self._data[pos.x * R * R + pos.y * R + pos.z] = value