public static void CalculateIterators(GameObject pRootNode) { // FIX Todo have this backed into PCSTree Debug.Assert(pRootNode != null); PCSTreeIterator.pRoot = pRootNode; PCSTreeIterator.pWrongParent = (GameObject)pRootNode.pParent; PCSTreeIterator.pCurrent = PCSTreeIterator.pRoot; GameObject pPrevGameObj = (GameObject)pRootNode; // Initialize the reserve pointer GameObject pGameObj = (GameObject)pRootNode; while (pGameObj != null) { // fill the basis pPrevGameObj = pGameObj; // Advance pGameObj = PCSTreeIterator.privSecretNext(); pPrevGameObj.pForward = pGameObj; if (pGameObj != null) { pGameObj.pReverse = pPrevGameObj; } } // pRootNode.pForward.pReverse = pRootNode; pRootNode.pReverse = pPrevGameObj; }
public static void CalculateIterators(GameObject pRootNode) { Debug.Assert(pRootNode != null); PCSTreeIterator.root = pRootNode; PCSTreeIterator.wrongParent = (GameObject)pRootNode.pParent; PCSTreeIterator.current = PCSTreeIterator.root; GameObject pPrevGameObj = (GameObject)pRootNode; GameObject pGameObj = (GameObject)pRootNode; while (pGameObj != null) { pPrevGameObj = pGameObj; pGameObj = PCSTreeIterator.privSecretNext(); pPrevGameObj.pForward = pGameObj; if (pGameObj != null) { pGameObj.pReverse = pPrevGameObj; } } pRootNode.pReverse = pPrevGameObj; }
public static void CalculateIterators(GameObject pRootNode) { // FIX Todo have this backed into PCSTree Debug.Assert(pRootNode != null); PCSTreeIterator.pRoot = pRootNode; PCSTreeIterator.pWrongParent = (GameObject)pRootNode.pParent; PCSTreeIterator.pCurrent = PCSTreeIterator.pRoot; GameObject pPrevGameObj = (GameObject)pRootNode; // Initialize the reserve pointer GameObject pGameObj = (GameObject)pRootNode; //iterate through while (pGameObj != null) { // fill the basis pPrevGameObj = pGameObj; // Advance pGameObj = PCSTreeIterator.privSecretNext(); //set the forward path pPrevGameObj.pForward = pGameObj; //if there is no next, at end of list if (pGameObj != null) { //set the reverse path pGameObj.pReverse = pPrevGameObj; } } ////Todo check on forward or reverse iterator for Calculating Iterators in PCSTreeIterators //pRootNode.pForward.pReverse = pRootNode; pRootNode.pReverse = pPrevGameObj; }