@pragma('vm:prefer-inline') bool inBounds2d(int x, int y) => x >= 0 && x < width && y >= 0 && y < height;