Example #1
0
        // Initialize application library
        public Asset(string sourcePath)
        {
            BuildDependencies = new AssetGraphNode(this);
            Dependencies      = new AssetGraphNode(this);

            ConvertableToTypes = new List <string>();
            ResourcePath       = sourcePath;
            SourceFilePath     = PathTool.ConvertProjectToAbsolute(ResourcePath);
        }
Example #2
0
        public void RemoveDependency(AssetGraphNode dependencyToRemove)
        {
            AssetGraphNode removed;
            var            ret = Dependencies.TryRemove(dependencyToRemove.SourcePath, out removed);

            ToolDebug.Assert(ret);
            if (ret)
            {
                ret = dependencyToRemove.References.TryRemove(SourcePath, out removed);
                ToolDebug.Assert(ret);
            }
        }
Example #3
0
        public ResultCode AddDependency(AssetGraphNode dependency)
        {
            var added = Dependencies.AddOrUpdate(dependency.SourcePath, dependency, (x, oldValue) => {
                ToolDebug.Assert(oldValue == dependency);
                return(oldValue);
            });

            if (added != dependency)
            {
                return(new ResultCode(ResultCode.SUCCESS_FALSE));
            }

            dependency.References.AddOrUpdate(SourcePath, this, (x, oldValue) => {
                ToolDebug.Assert(oldValue == this);
                return(this);
            });

            return(new ResultCode(ResultCode.SUCCESS));
        }
Example #4
0
        public bool Contains(AssetGraphNode dependency)
        {
            AssetGraphNode existDependency;

            return(Dependencies.TryGetValue(dependency.SourcePath, out existDependency));
        }