public LayoutImpl(int[][] f) {
		grid = new Cell[8][8];
		
		for (int x = 0; x < 8; x++) {
			for (int y = 0; y < 8; y++) {
				grid[x][y] = new CellImpl(new Point(y, x), f[x][y]);
			}
		}
		
		
		gridCount = new int[4][3][16];
		for (int q = 0; q < 4; q++) {
			for (int w = 0; w < 3; w++) {
				for (int e = 0; e < 16; e++) {
					gridCount[q][w][e] = 0;
				}
			}
		}


		for (int x = 0; x < 8; x++) {
			for (int y = 0; y < 8; y++) {
				for (int direction = 0; direction < DIRECTION.length; direction++) {
					int d = DIRECTION[direction];
					int color = getCell(new Point(y, x)).getPieceColor();
					int index = getIndex(new Point(y, x), d);
					gridCount[d][color][index]++;
				}
			}
		}
	}