Example #1
0
        public override void Delete()
        {
            base.Delete();

            if (Rubble != null)
            {
                List <Item> rubble = new List <Item>(Rubble);

                rubble.ForEach(i => i.Delete());
                rubble.ForEach(i => Rubble.Remove(i));

                rubble.Clear();
                rubble.TrimExcess();
            }
        }
Example #2
0
        public override bool OnBeforeDestroyed()
        {
            if (Controller != null)
            {
                Controller.OnBeaconDestroyed();
            }

            List <Item> delete = new List <Item>();

            if (Rubble != null)
            {
                foreach (Item i in Rubble.Where(item => item.Z > this.Z))
                {
                    i.Delete();
                    delete.Add(i);
                }

                delete.ForEach(i => Rubble.Remove(i));
            }

            DoEffects();

            if (Component != null)
            {
                Component.ItemID  = 1;
                Component.Visible = false;
            }

            Visible = false;

            delete.Clear();
            delete.TrimExcess();

            AddRubble(new Static(634), new Point3D(this.X - 2, this.Y, this.Z));
            AddRubble(new Static(633), new Point3D(this.X - 2, this.Y + 1, this.Z));

            AddRubble(new Static(635), new Point3D(this.X + 2, this.Y - 2, this.Z));
            AddRubble(new Static(632), new Point3D(this.X + 3, this.Y - 2, this.Z));

            AddRubble(new Static(634), new Point3D(this.X + 2, this.Y, this.X));
            AddRubble(new Static(633), new Point3D(this.X + 2, this.Y + 1, this.Z));
            return(true);
        }