getIndex method

int getIndex(
  1. int x,
  2. int y
)

Implementation

int getIndex(int x, int y) {
  switch (coordinatePlane) {
    case CacheCoordinatePlane.normal:
      return ((y % height) * width) + (x % width);
    case CacheCoordinatePlane.mirrored:
      return (_zigZag(y, height) * width) + _zigZag(x, width);
  }
}