Esempio n. 1
0
		/// <summary>
		/// Checks the list of stored Raid and Heroic instances and the list of recently run Normal 
		/// instances for a reference to the given map.
		/// </summary>
		/// <param name="template">The MapInfo of the Instance in question.</param>
		/// <returns>The Instance if found, else null.</returns>
		public BaseInstance GetActiveInstance(MapTemplate template)
		{
			var chr = Character;
			if (chr == null)
			{
				return null;
			}

			var binding = GetBinding(template.Id, template.GetDifficulty(chr.GetInstanceDifficulty(template.IsRaid)).BindingType);
			if (binding != null)
			{
				var instance = InstanceMgr.Instances.GetInstance(binding.MapId, binding.InstanceId);
				if (instance.IsActive)
				{
					return instance as BaseInstance;
				}
			}
			return null;
		}