public void RemoveNodeInfo(int id)
{
// Remove all attributeInfos from nodeInfo
List<int> attrKeys = new List<int>(nodeInfo[id - 1].attributeInfo.Keys);
while (nodeInfo[id - 1].attributeInfo.Count > 0)
{
RemoveAttributeInfo(attrKeys[0]);
}
attrKeys = null;
// Shift all succeeding nodeInfos and change their id
for (int i = id - 1; i < nodeInfo.Length - 1; i++)
{
nodeInfo[i] = nodeInfo[i + 1];
nodeInfo[i].id = i + 1;
}
Array.Resize(ref nodeInfo, nodeInfo.Length - 1);
// Delete from CNode
if (rootNode != null)
{
if (rootNode.id == id)
{
rootNode = null;
}
else
{
rootNode.RemoveNodeInfo(id);
}
}
}