Example #1
0
        public object Clone()
        {
            DisplaySprite s = new DisplaySprite();

            s.CustomBit   = this.CustomBit;
            s.Description = this.Description;
            s.ExtraBit    = this.ExtraBit;
            s.Tiles       = new BindingList <Tile>();
            foreach (Tile t in Tiles)
            {
                s.Tiles.Add((Tile)t.Clone());
            }
            s.X           = this.X;
            s.Y           = this.Y;
            s.DisplayText = this.DisplayText;
            s.UseText     = this.UseText;
            return(s);
        }
Example #2
0
        public override bool Equals(object obj)
        {
            if (object.ReferenceEquals(this, obj))
            {
                return(true);
            }
            if (object.ReferenceEquals(this, null))
            {
                return(false);
            }

            DisplaySprite sp = obj as DisplaySprite;

            if (object.ReferenceEquals(sp, null))
            {
                return(false);
            }

            return(sp.CustomBit == CustomBit && sp.ExtraBit == ExtraBit &&
                   sp.Description == Description && sp.DisplayText == DisplayText && sp.UseText == UseText &&
                   sp.Tiles.SequenceEqual(Tiles));
        }