Exemple #1
0
        public static bool CheckIntegrity(this IGraphModel self, Verbosity errors)
        {
            Assert.IsTrue((Object)self.AssetModel, "graph asset is invalid");
            bool failed = false;

            for (var i = 0; i < self.EdgeModels.Count; i++)
            {
                var edge = self.EdgeModels[i];
                if (edge.ToPort == null)
                {
                    failed = true;
                    Debug.Log($"Edge {i} toPort is null, output: {edge.FromPort}");
                }

                if (edge.FromPort == null)
                {
                    failed = true;
                    Debug.Log($"Edge {i} output is null, toPort: {edge.ToPort}");
                }
            }

            self.CheckNodeList();
            if (!failed && errors == Verbosity.Verbose)
            {
                Debug.Log("Integrity check succeeded");
            }
            return(!failed);
        }