Ejemplo n.º 1
0
        /// <summary>
        /// Gets a normal Map by its Id
        /// </summary>
        /// <returns>the <see cref="Map" /> object; null if the ID is not valid</returns>
        public static Map GetMap(IMapId mapId)
        {
            if (mapId.InstanceId > 0)
            {
                var templ = GetMapTemplate(mapId.MapId);
                if (templ == null)
                {
                    return(null);
                }

                if (templ.IsBattleground)
                {
                    return(BattlegroundMgr.Instances.GetInstance(templ.BattlegroundTemplate.Id, mapId.InstanceId));
                }
                else
                {
                    return(InstanceMgr.Instances.GetInstance(mapId.MapId, mapId.InstanceId));
                }
            }
            return(s_Maps.Get((uint)mapId.MapId));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Gets a normal Map by its Id
        /// </summary>
        /// <returns>the <see cref="Map" /> object; null if the ID is not valid</returns>
        public static Map GetMap(IMapId mapId)
        {
            if (mapId.InstanceId > 0)
            {
                var templ = GetMapTemplate(mapId.MapId);
                if (templ == null) return null;

                if (templ.IsBattleground)
                {
                    return BattlegroundMgr.Instances.GetInstance(templ.BattlegroundTemplate.Id, mapId.InstanceId);
                }
                else
                {
                    return InstanceMgr.Instances.GetInstance(mapId.MapId, mapId.InstanceId);
                }
            }
            return s_Maps.Get((uint)mapId.MapId);
        }
Ejemplo n.º 3
0
		/// <summary>
		/// Gets an instance
		/// </summary>
		/// <returns>the <see cref="Map" /> object; null if the ID is not valid</returns>s
		public static InstancedMap GetInstance(IMapId mapId)
		{
			var instances = GetInstances(mapId.MapId);
			if (instances != null)
			{
				return instances.Get(mapId.InstanceId);
			}
			return null;
		}
Ejemplo n.º 4
0
		/// <summary>
		/// Gets a normal Map by its Id
		/// </summary>
		/// <returns>the <see cref="Map" /> object; null if the ID is not valid</returns>
		public static Map GetMap(IMapId mapId)
		{
			if (mapId.InstanceId > 0)
			{
				return GetInstance(mapId);
			}
			return s_Maps.Get((uint)mapId.MapId);
		}