Empeld
Empeld plugin documentation.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events
essentials.action.ItemFramework.ItemEntityExtensions Class Reference

Item extensions to interact with entities More...

Static Public Member Functions

static IItemDrop DropItem (this IEntityManager entityManager, IItem item, Vector3d position)
 Drop an item in the world More...
 
static IItemDrop DropItem< T > (this IEntityManager entityManager, Vector3d position)
 Drop a new item of type T in the world More...
 
static IEnumerable< IItemDropFindItemsNear (this IEntityManager entityManager, Vector3d pos, double radius)
 Finds the items near a given position More...
 

Detailed Description

Item extensions to interact with entities

Member Function Documentation

static IItemDrop essentials.action.ItemFramework.ItemEntityExtensions.DropItem ( this IEntityManager  entityManager,
IItem  item,
Vector3d  position 
)
static

Drop an item in the world

Returns
The item.
Parameters
entityManagerEntity manager.
itemItem.
positionPosition.
22  {
23  var drop = new ItemDropEntity(item, position);
24  entityManager.Spawn(drop);
25  return drop;
26  }
static IItemDrop essentials.action.ItemFramework.ItemEntityExtensions.DropItem< T > ( this IEntityManager  entityManager,
Vector3d  position 
)
static

Drop a new item of type T in the world

Returns
The item.
Parameters
entityManagerEntity manager.
positionPosition.
Template Parameters
TThe 1st type parameter.
Type Constraints
T :class 
T :IItem 
T :new() 
36  : class, IItem, new()
37  {
38  var item = new T();
39  var drop = new ItemDropEntity(item, position);
40  entityManager.Spawn(drop);
41  return drop;
42  }
static IEnumerable<IItemDrop> essentials.action.ItemFramework.ItemEntityExtensions.FindItemsNear ( this IEntityManager  entityManager,
Vector3d  pos,
double  radius 
)
static

Finds the items near a given position

Returns
The items near.
Parameters
entityManagerEntity manager.
posPosition.
radiusRadius.
52  {
53  return entityManager.GetEntitiesNear<IItemDrop>(pos, radius);
54  }
Represents an item that has been dropped in the world
Definition: IItemDrop.cs:10

The documentation for this class was generated from the following file: