public override PlayerColour?getWinner() { owner = owner == null?winChecker.checkForWin(this) : owner; if (owner == null) { throw new NoWinnerException(); } return(owner); }
public PlayerColour?checkForWin(BoardGame game) { Point p = check(game); PlayerColour?result = null; if (p.X != -1) { result = game.getBoard()[p.X][p.Y].getWinner(); } else if (successor != null) { result = successor.checkForWin(game); } return(result); }