public Player getWinner() {
		int height = board.getHeight();
		int width = board.getWidth();
		boolean[][] visited = new boolean[height][width];
		if (!canMove()) {
			if (turn == Checker.WHITETURN) {
				return black;
			} else {
				return white;
			}
		}
		for (int x = 0; x < height; x++) {
			for (int y = 0; y < width; y++) {
				visited[x][y] = false;
			}
		}
		Player winner = null;
		for (int colori = 0; colori < Checker.COLORS.length; colori++) {
			int color = Checker.COLORS[colori];
			if (color == Checker.EMPTYCELL) {
				continue;
			}
			for (int x = 0; x < height; x++) {
				for (int y = 0; y < width; y++) {
					if (board.sameColor(new Point(y, x), color)) {
						floodfill(new Point(y, x), visited, color);
						x = height;
						break;
					}
				}
			}
			boolean won = true;
			for (int x = 0; x < height; x++) {
				for (int y = 0; y < width; y++) {
					if (board.sameColor(new Point(y, x), color) && !visited[x][y]) {
						won = false;
					}
				}
			}
			if (won && !(winner != null && winner.getColor() != getTurn().getColor())) {
				if (color == Checker.WHITE) {
					winner = white;
				} else {
					winner = black;
				}
			}
		}
		return winner;
	}