protected void Constructor(int width, int height) { cells = new csDungeonCell[width, height]; bounds = new Rect(0, 0, width, height); // Initialize the array of cells foreach (Vector2 location in CellLocations) { this[location] = new csDungeonCell(); } }
public void InitializeRoomCells() { foreach (Vector2 location in CellLocations) { csDungeonCell cell = new csDungeonCell(); cell.WestSide = (location.x == bounds.x) ? csDungeonCell.SideType.Wall : csDungeonCell.SideType.Empty; cell.EastSide = (location.x == bounds.width - 1) ? csDungeonCell.SideType.Wall : csDungeonCell.SideType.Empty; cell.NorthSide = (location.y == bounds.y) ? csDungeonCell.SideType.Wall : csDungeonCell.SideType.Empty; cell.SouthSide = (location.y == bounds.height - 1) ? csDungeonCell.SideType.Wall : csDungeonCell.SideType.Empty; this[location] = cell; } }