Ink.Parsed.Weave.CheckForWeavePointNamingCollisions C# (CSharp) Method

CheckForWeavePointNamingCollisions() public method

public CheckForWeavePointNamingCollisions ( ) : void
return void
        void CheckForWeavePointNamingCollisions()
        {
            if (_namedWeavePoints == null)
                return;
            
            var ancestorFlows = new List<FlowBase> ();
            foreach (var obj in this.ancestry) {
                var flow = obj as FlowBase;
                if (flow)
                    ancestorFlows.Add (flow);
                else
                    break;
            }


            foreach (var namedWeavePointPair in _namedWeavePoints) {
                var weavePointName = namedWeavePointPair.Key;
                var weavePoint = (Parsed.Object) namedWeavePointPair.Value;

                foreach(var flow in ancestorFlows) {

                    // Shallow search
                    var otherContentWithName = flow.ContentWithNameAtLevel (weavePointName);

                    if (otherContentWithName && otherContentWithName != weavePoint) {
                        var errorMsg = string.Format ("{0} '{1}' has the same label name as a {2} (on {3})", 
                            weavePoint.GetType().Name, 
                            weavePointName, 
                            otherContentWithName.GetType().Name, 
                            otherContentWithName.debugMetadata);

                        Error(errorMsg, (Parsed.Object) weavePoint);
                    }

                }
            }
        }