示例#1
0
        private void processRecurse(DependencyNode node)
        {
            if (!node.mFileInfo.bExists)
            {
                return;
            }

            // Create list of files that this node depends on
            List <FileInfo> dependencies = new List <FileInfo>();

            DependencyManager.getDependencyList(node.filename, dependencies, node.mUnitList);


            // Add a child node to given node for each dependency file in the list
            foreach (FileInfo dependentFileInfo in dependencies)
            {
                DependencyNode childNode = new DependencyNode(dependentFileInfo);
                node.addChild(childNode);
            }

            // Now recurse into the child nodes
            int numChildren = node.getNumChildren();

            for (int i = 0; i < numChildren; i++)
            {
                processRecurse(node.getChild(i));
            }
        }
示例#2
0
        public DependencyTree(List <string> fileNames)
        {
            // Create root node
            mRootNode = new DependencyNode(new FileInfo("root", false));

            // Add first level dependencies
            foreach (string fileName in fileNames)
            {
                // Check file existance
                bool fileExists = File.Exists(CoreGlobals.getWorkPaths().mGameDirectory + "\\" + fileName);

                DependencyNode node = new DependencyNode(new FileInfo(fileName, fileExists));

                mRootNode.addChild(node);
            }
        }