public void fill(int n, int tx, int ty, int oldval, int newval) {
		int[][] map;
		map = maps.get(n).tiles;

		if (isTileInMap(tx, ty, map)) {
			// mark tiles as belonging to area
			map[ty][tx] = FILL_TEMP_VAL;

			boolean foundOne;
			do {
				foundOne = false;
				for (int xi = 0; xi < map[0].length; xi++) {
					for (int yi = 0; yi < map.length; yi++) {
						if (map[yi][xi] == FILL_TEMP_VAL && markSameValuedNeighbourENWS(oldval, xi, yi, map)) {
							foundOne = true;
						}
					}
				}
			} while (foundOne);

			// change tile values
			for (int xi = 0; xi < map[0].length; xi++) {
				for (int yi = 0; yi < map.length; yi++) {
					if (map[yi][xi] == FILL_TEMP_VAL)
						map[yi][xi] = newval;
				}
			}
		}

	}