public void AddChild(MoveVariation child)
        {
            if (_children == null)
            {
                _children = new List <MoveVariation>();
            }

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

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

            if (currentMoveItem != null)
            {
                gameMoves += currentMoveItem.Move + _movesSeparator;
                GetParentMove(ref gameMoves, currentMoveItem);
            }
            return(gameMoves);
        }
 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;
 }
        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);
            }
        }