예제 #1
0
파일: CellMover.cs 프로젝트: deimors/2048
        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);
        }