예제 #1
0
        public override PlayerColour?getWinner()
        {
            owner = owner == null?winChecker.checkForWin(this) : owner;

            if (owner == null)
            {
                throw new NoWinnerException();
            }
            return(owner);
        }
예제 #2
0
        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);
        }