예제 #1
0
        public void AddChild(MoveVariation child)
        {
            if (_children == null)
            {
                _children = new List <MoveVariation>();
            }

            _children.Add(child);
        }
예제 #2
0
        private static void GetParentMove(ref string gameMoves, MoveVariation currentMoveItem)
        {
            if (currentMoveItem.Parent == null)
            {
                return;
            }

            gameMoves += currentMoveItem.Parent.Move + _movesSeparator;
            GetParentMove(ref gameMoves, currentMoveItem.Parent);
        }
예제 #3
0
        public static string GetGameMovesFromCurrentNodeToRoot(MoveVariation currentMoveItem)
        {
            string gameMoves = string.Empty;

            if (currentMoveItem != null)
            {
                gameMoves += currentMoveItem.Move + _movesSeparator;
                GetParentMove(ref gameMoves, currentMoveItem);
            }
            return(gameMoves);
        }
예제 #4
0
 public MoveVariation(
     MoveVariation parent, int moveNumber, int variationNumber,
     bool isColor, string move, string fenNotation
     )
 {
     _parent          = parent;
     _moveNumber      = moveNumber;
     _variationNumber = variationNumber;
     _isColor         = isColor;
     _move            = move;
     _fenNotation     = fenNotation;
 }
예제 #5
0
        public static void AddMoveItem(MoveVariation parentMoveItem, MoveVariation currentMoveItem)
        {
            if (parentMoveItem == null)
            {
                if (_moveVariations == null)
                {
                    _moveVariations = new List <MoveVariation>();
                }

                _moveVariations.Add(currentMoveItem);
            }
            else
            {
                parentMoveItem.AddChild(currentMoveItem);
            }
        }