コード例 #1
0
ファイル: AssetGraphNode.cs プロジェクト: blue3k/StormForge
        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));
        }