public void UnRegisterDungeon(GroupDungeonStone stone)
 {
     if (stone.IRegion != null)
     {
         stone.IRegion.Unregister();
     }
 }
Esempio n. 2
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 0:
            {
                m_Stone = (GroupDungeonStone)reader.ReadItem();
                break;
            }
            }
        }
        public GroupDungeonRegion RegisterDungeon(GroupDungeonStone stone)
        {
            if (stone != null)
            {
                //Build Rect2d from the stone, then register the region.
                Point2D     center = new Point2D(stone.X, stone.Y);
                Point2D     start  = new Point2D(center.X - stone.Size, center.Y - stone.Size);
                Point2D     end    = new Point2D(center.X + stone.Size, center.Y + stone.Size);
                Rectangle2D box    = new Rectangle2D(start, end);

                GroupDungeonRegion reg = new GroupDungeonRegion(stone, stone.Map, stone.DungeonName, box);
                reg.DungeonReset();
                reg.Register();

                return(reg);
            }
            else
            {
                return(null);
            }
        }
        public GroupDungeonRegion RegisterDungeon(GroupDungeonStone stone)
        {
            if (stone != null)
            {
                //Build Rect2d from the stone, then register the region.
                Point2D center = new Point2D(stone.X, stone.Y);
                Point2D start = new Point2D(center.X - stone.Size, center.Y - stone.Size);
                Point2D end = new Point2D(center.X + stone.Size, center.Y + stone.Size);
                Rectangle2D box = new Rectangle2D(start, end);

                GroupDungeonRegion reg = new GroupDungeonRegion(stone, stone.Map, stone.DungeonName, box);
                reg.DungeonReset();
                reg.Register();

                return reg;
            }
            else return null;
        }
 public void UnRegisterDungeon(GroupDungeonStone stone)
 {
     if (stone.IRegion != null)
         stone.IRegion.Unregister();
 }
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
                case 0:
                    {
                        m_Stone = (GroupDungeonStone)reader.ReadItem();
                        break;
                    }
            }
        }
 public GroupDungeonRegion(GroupDungeonStone stone, Map map, string name, Rectangle2D area)
     : base(name, map, 0, area)
 {
     //Link the region to a control stone, and vise-versa.
     m_Stone = stone; stone.IRegion = this;
     m_PlayerMovements = new List<PlayerMovementEntry>();
     m_AFKTimer = new AFKTimer(this);
 }