PlacementGrid.PlacementGrid C# (CSharp) Method

PlacementGrid() public method

public PlacementGrid ( int width, int height, bool closedSpots ) : UnityEngine
width int
height int
closedSpots bool
return UnityEngine
	public PlacementGrid(int width, int height, bool[] closedSpots) {
		// Make sure inital parameters make sense
		if (width * height != closedSpots.Length) {
			throw new UnityException ("Invalid size of array given width and height.");
		}
		this.rotation = 0;
		this.width = width;
		this.height = height;
		// Create internal array
		internalCells = new PGridCell[closedSpots.Length];
		for (int i = 0; i < closedSpots.Length; i++) {
			internalCells [i] = new PGridCell (i / width, i % width, closedSpots [i]);
		}
	}