Aura.Channel.World.Region.GetProp C# (CSharp) Method

GetProp() public method

Returns first prop that matches the predicate, or null if no matching props were found.
public GetProp ( bool>.Func predicate ) : Prop
predicate bool>.Func
return Aura.Channel.World.Entities.Prop
		public Prop GetProp(Func<Prop, bool> predicate)
		{
			Prop result;

			_propsRWLS.EnterReadLock();
			try
			{
				result = _props.Values.FirstOrDefault(predicate);
			}
			finally
			{
				_propsRWLS.ExitReadLock();
			}

			return result;
		}

Same methods

Region::GetProp ( long entityId ) : Prop

Usage Example

Ejemplo n.º 1
0
		/// <summary>
		/// Returns entity by id or null.
		/// </summary>
		/// <param name="entityId"></param>
		/// <returns></returns>
		private Entity GetTargetEntity(Region region, long entityId)
		{
			var isProp = (entityId >= MabiId.ClientProps && entityId < MabiId.AreaEvents);
			var targetEntity = (isProp ? (Entity)region.GetProp(entityId) : (Entity)region.GetCreature(entityId));

			return targetEntity;
		}