예제 #1
0
        /// <summary>
        /// Add Node to Graphs
        /// </summary>
        /// <param name="node"></param>
        /// <returns>Return Index of Node. If fail to add node, return -1</returns>
        public int AddNode(MyGraphNode node)
        {
            if (node.getIndex() == 0)
                node.setIndex(index: GetNextFreeNodeIndex());

            if (!isPresent(node.getIndex()))
            {
                m_Nodes.Add(node);
            }
            return node.getIndex();
        }
예제 #2
0
        /// <summary>
        /// Add Node to Graphs
        /// </summary>
        /// <param name="node"></param>
        /// <returns>Return Index of Node. If fail to add node, return -1</returns>
        public int AddNode(MyGraphNode node)
        {
            if (node.getIndex() == 0)
            {
                node.setIndex(index: GetNextFreeNodeIndex());
            }

            if (!isPresent(node.getIndex()))
            {
                m_Nodes.Add(node);
            }
            return(node.getIndex());
        }
예제 #3
0
        /// <summary>
        /// Add Node to Graphs
        /// </summary>
        /// <param name="node"></param>
        /// <returns>Return Index of Node. If fail to add node, return -1</returns>
        public int AddNode(MyGraphNode node)
        {
            node.setIndex(index: GetNextFreeNodeIndex());
            m_iNextNodeIndex += 1;

            if (true)
            {
                m_Nodes.Add(node);
                return node.getIndex();
            }
            else
            {
                return -1;
            }
        }
예제 #4
0
        /// <summary>
        /// Add Node to Graphs
        /// </summary>
        /// <param name="node"></param>
        /// <returns>Return Index of Node. If fail to add node, return -1</returns>
        public int AddNode(MyGraphNode node)
        {
            node.setIndex(index: GetNextFreeNodeIndex());
            m_iNextNodeIndex += 1;

            if (true)
            {
                m_Nodes.Add(node);
                return(node.getIndex());
            }
            else
            {
                return(-1);
            }
        }