package clue;

public class BoardCell {
	protected Integer index, top, right, bottom, left;

	public BoardCell(int i, int rows, int cols) {
		index = i;
		// Initialize our links.
		if((index - cols) >= 0)
			top = index - cols;
		if((index + cols) < (rows*cols))
			bottom = index + cols;
		if((index % cols) > 0)
			left = index - 1;
		if(((index + 1) % cols) > 0)
			right = index + 1;
	}

	// Auto-generated by Eclipse. This lets us compare two BoardCells.
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((index == null) ? 0 : index.hashCode());
		return result;
	}

	// See above.
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		BoardCell other = (BoardCell) obj;
		if (index == null) {
			if (other.index != null)
				return false;
		} else if (!index.equals(other.index))
			return false;
		return true;
	}

	// Allows us to print things like HashSet<BoardCell>s.
	public String toString() {
		return index.toString();
	}

	// By default, all of these return false.
	public boolean isWalkway() {
		return false;
	}

	public boolean isRoom() {
		return false;
	}

	public boolean isDoorway() {
		return false;
	}
}

@@ -115,17 +115,20 @@
  i, int 
-r
+numR
 ows, int
@@ -128,17 +128,20 @@
 ws, int 
-c
+numC
 ols) %7B%0A%09
@@ -193,17 +193,20 @@
 index - 
-c
+numC
 ols) %3E= 
@@ -225,17 +225,20 @@
 index - 
-c
+numC
 ols;%0A%09%09i
@@ -252,17 +252,20 @@
 x + 
-c
+numC
 ols) %3C (
 rows
@@ -264,14 +264,20 @@
  %3C (
-rows*c
+numRows*numC
 ols)
@@ -298,17 +298,20 @@
 index + 
-c
+numC
 ols;%0A%09%09i
@@ -321,17 +321,20 @@
 index %25 
-c
+numC
 ols) %3E 0
@@ -376,17 +376,20 @@
  + 1) %25 
-c
+numC
 ols) %3E 0

Change rows and cols to numRows and numCols.