/// <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(); }
/// <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()); }
/// <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; } }
/// <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); } }