Exemplo n.º 1
0
        public bool MoveAllCells(Direction direction)
        {
            var anyMoves = false;

            foreach (var candidate in _board.GetMoveCandidates(direction))
            {
                candidate.Target.Match(
                    targetPos =>
                {
                    MoveToTarget(candidate.Origin, targetPos, candidate.Number);
                    anyMoves = true;
                },
                    () => { }
                    );
            }

            return(anyMoves);
        }