Example #1
0
        public static void QueryGuardlineData(NetState state, PacketReader pvSrc)
        {
            try {
                Mobile from = state.Mobile;
                Map    map  = from.Map;

                if (map != null)
                {
                    state.Send(GuardlineData.Acquire(map));
                }
            } catch (Exception ex) {
                Console.WriteLine(ex);
            }
        }
Example #2
0
        public static GuardlineData Acquire(Map map)
        {
            if (map == null)
            {
                throw new ArgumentNullException("map");
            }

            if (_cache == null)
            {
                _cache = new Dictionary <Map, GuardlineData>();
            }

            GuardlineData gd;

            if (!_cache.TryGetValue(map, out gd))
            {
                gd = new GuardlineData(map);
                gd.SetStatic();
                _cache.Add(map, gd);
            }

            return(gd);
        }