Exemplo n.º 1
0
        private bool DisksToChangeForDirection(int place, Players player, WindDirection direction, List <int> disksToChange)
        {
            bool directionIsValid;

            place = direction.TranslateDirection()
                    .AddDirectionToCoordinate(place, BOARD_WIDTH);

            // Iterate over opponents pieces
            if (Board[place] == player.Negate())
            {
                directionIsValid = DisksToChangeForDirection(place, player, direction, disksToChange);
                if (directionIsValid)
                {
                    disksToChange.Add(place);
                }
            }
            else
            {
                // Return whetere there is a piece of the palyer at the end.
                directionIsValid = Board[place] == player;
            }

            return(directionIsValid);
        }