/** * Fill up the grid so the diamon becomes a rectangle. */ private void FillUnusableGrid() { for (int y = 0; y < gridSize; y++) { for (int x = 0; x < gridSize; x++) { // Fill Bottom if (x + y < gridUnusuableHeight) { grid[x, y] = new UnusableGrid(); } // Fill Top if (x + y > (gridSize * 2) - gridUnusuableHeight) { grid[x, y] = new UnusableGrid(); } // Fill Left if (x - y > gridSize - gridUnusuableWidth) { grid[x, y] = new UnusableGrid(); } // Fill Right if (y - x > gridSize - gridUnusuableWidth) { grid[x, y] = new UnusableGrid(); } } } for (int y = 0; y < gridSize; y++) { for (int x = 0; x < gridSize; x++) { } } // Fill Left for (int y = 0; y < gridSize; y++) { for (int x = 0; x < gridSize; x++) { if (x + y > (gridSize * 2) - gridUnusuableHeight) { grid[x, y] = new UnusableGrid(); } } } // Fill Right for (int y = 0; y < gridSize; y++) { for (int x = 0; x < gridSize; x++) { if (x + y > (gridSize * 2) - gridUnusuableHeight) { grid[x, y] = new UnusableGrid(); } } } }
/** * Fill up the grid so the diamon becomes a rectangle. */ private void FillUnusableGrid() { for (int y = 0; y < gridSize; y++) { for (int x = 0; x < gridSize; x++) { // Fill Bottom if (x+y < gridUnusuableHeight) { grid[x,y] = new UnusableGrid(); } // Fill Top if (x + y > (gridSize * 2) - gridUnusuableHeight) { grid[x,y] = new UnusableGrid(); } // Fill Left if (x - y > gridSize - gridUnusuableWidth) { grid[x,y] = new UnusableGrid(); } // Fill Right if (y - x > gridSize - gridUnusuableWidth) { grid[x,y] = new UnusableGrid(); } } } for (int y = 0; y < gridSize; y++) { for (int x = 0; x < gridSize; x++) { } } // Fill Left for (int y = 0; y < gridSize; y++) { for (int x = 0; x < gridSize; x++) { if (x + y > (gridSize * 2) - gridUnusuableHeight) { grid[x,y] = new UnusableGrid(); } } } // Fill Right for (int y = 0; y < gridSize; y++) { for (int x = 0; x < gridSize; x++) { if (x + y > (gridSize * 2) - gridUnusuableHeight) { grid[x,y] = new UnusableGrid(); } } } }