Esempio n. 1
0
        public object Clone()
        {
            CustomArrow ca = (CustomArrow)this.MemberwiseClone();

            ca.path = (path != null ? path : null);
            ca.type = (type != null ? type : null);
            return(ca);
        }
Esempio n. 2
0
        /**
         * Deletes a given asset from the script, removing all occurrences.
         *
         * @param assetPath
         *            Path of the asset (relative to the ZIP), without suffix in
         *            case of an animation or set of slides
         */
        public void deleteAssetReferences(string assetPath)
        {
            if (assetPath != null)
            {
                // Firstly iterate arrows
                for (int i = 0; i < arrows.Count; i++)
                {
                    CustomArrow arrow = arrows[i];
                    if (arrow.getPath() != null && arrow.getPath().Equals(assetPath))
                    {
                        arrow.setPath(null);
                    }

                    if (arrow.getSoundPath() != null && arrow.getSoundPath().Equals(assetPath))
                    {
                        arrow.setSoundPath(null);
                    }

                    if (arrow.getPath() == null && arrow.getSoundPath() == null)
                    {
                        arrows.RemoveAt(i);
                        i--;
                    }
                }
                // Secondly iterate buttons
                for (int i = 0; i < buttons.Count; i++)
                {
                    CustomButton button = buttons[i];
                    if (button.getPath() != null && button.getPath().Equals(assetPath))
                    {
                        button.setPath(null);
                    }

                    if (button.getSoundPath() != null && button.getSoundPath().Equals(assetPath))
                    {
                        button.setSoundPath(null);
                    }

                    if (button.getPath() == null && button.getSoundPath() == null)
                    {
                        arrows.RemoveAt(i);
                        i--;
                    }
                }
                // Finally iterate cursors
                for (int i = 0; i < cursors.Count; i++)
                {
                    CustomCursor cursor = cursors[i];
                    if (cursor.getPath() != null && cursor.getPath().Equals(assetPath))
                    {
                        cursors.RemoveAt(i);
                        i--;
                    }
                }
            }
        }
Esempio n. 3
0
        public override bool Equals(System.Object o)
        {
            if (o == null || !(o is CustomArrow))
            {
                return(false);
            }
            CustomArrow arrow = (CustomArrow)o;

            if (arrow.type.Equals(type))
            {
                return(true);
            }
            return(false);
        }
Esempio n. 4
0
        public void addArrow(string type, string path)
        {
            CustomArrow ca = new CustomArrow(type, path);

            arrows.Add(ca);
        }
Esempio n. 5
0
 public void addArrow(CustomArrow arrow)
 {
     arrows.Add(arrow);
 }