Example #1
0
        public InstanceMap(int index, Map parent, string name, Season season, MapRules rules)
            : base(parent.MapID, index, parent.MapID, parent.Width, parent.Height, (int)season, name, rules)
        {
            InstanceRegions = new List <InstanceRegion>();

            Mobiles = new List <Mobile>();
            Items   = new List <Item>();

            BounceInfo = new Dictionary <PlayerMobile, MapPoint>();

            if (!Maps.InBounds(MapIndex) || MapIndex == 255 || MapIndex == 127)
            {
                Serial  = new InstanceMapSerial(-MapIndex);
                Deleted = true;
                return;
            }

            Serial = new InstanceMapSerial(MapIndex);
            Parent = parent;

            Maps[MapIndex] = this;

            AllMaps.Add(this);

            UpdateMaps();
        }
Example #2
0
        private static bool SerializeMap(GenericWriter writer, InstanceMapSerial serial, InstanceMap map)
        {
            var version = writer.SetVersion(0);

            switch (version)
            {
            case 0:
            {
                writer.WriteBlock(w =>
                    {
                        WriteInstanceMap(w, map);

                        map.Serialize(w);
                    });
            }
            break;
            }

            return(true);
        }
Example #3
0
 public static InstanceMap FindMap(InstanceMapSerial serial)
 {
     return(Maps.GetValue(serial));
 }