public boolean equals(Object obj)
	{

		// Make sure it is a level.
		if (obj == null || !(obj instanceof Level))
			return false;

		// Compare it as a level.
		Level other = (Level) obj;

		// Check if the player is in the same spot.
		if (!player.equals(other.player))
			return false;

		// Check for equal dimensions.
		if (map.length != other.map.length
				|| map[0].length != other.map[0].length)
			return false;

		// Check for all tiles being equal.
		for (int row = 0; row < map.length; row++)
			for (int col = 0; col < map[row].length; col++)
				if (!map[row][col].equals(other.map[row][col]))
					return false;

		// If it has passed all the tests return true.
		return true;
	}