Catrobat.IDE.Core.Utilities.Helpers.ReferenceHelper.GetRepeatLoopEndBrickReferenceString C# (CSharp) Method

GetRepeatLoopEndBrickReferenceString() private static method

private static GetRepeatLoopEndBrickReferenceString ( XmlLoopEndBrick loopEndBrick ) : string
loopEndBrick Catrobat.IDE.Core.Xml.XmlObjects.Bricks.ControlFlow.XmlLoopEndBrick
return string
        private static string GetRepeatLoopEndBrickReferenceString(XmlLoopEndBrick loopEndBrick)
        {
            var sprite = XmlParserTempProjectHelper.Sprite;

            var script = XmlParserTempProjectHelper.Script;
                //TODO could this be dead code as since v93 there are no references like this?
                var count = 0;
                foreach (var brick in script.Bricks.Bricks)
                    if (brick is XmlRepeatLoopEndBrick)
                    {
                        count++;
                        if ((brick == loopEndBrick) && (count == 1))
                            return "../../loopEndBrick";
                        else if (brick == loopEndBrick)
                            return "../../loopEndBrick[" + count + "]";
                    }
            
            return "";
        }