Class EntityController
An Entity Controller with extra functionality for the client.
Inherited Members
Namespace: DuneNet.Client.Controllers
Assembly: DuneNet.Client.dll
Syntax
public sealed class EntityController : BaseEntityController
Methods
DestroyAllEntities()
Destroys all spawned entities.
Declaration
public void DestroyAllEntities()
DestroyEntity(Entity)
Destroys a spawned entity.
Declaration
public void DestroyEntity(Entity ent)
Parameters
Type | Name | Description |
---|---|---|
Entity | ent | The entity to destroy. |
GetEntities()
Returns all the spawned entities.
Declaration
public IEnumerable<Entity> GetEntities()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<Entity> | An IEnumerable instance of type Entity containing all the spawned entities. |
GetEntities<T>()
Returns all the spawned entities of the type specified.
Declaration
public IEnumerable<T> GetEntities<T>()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T> | An IEnumerable instance of type T containing all the spawned entities of that type. |
Type Parameters
Name | Description |
---|---|
T | The type of the entities to find. Must inherit from Entity |
GetEntityFromId(UInt32)
Returns a spawned entity identified by its ID.
Declaration
public Entity GetEntityFromId(uint entId)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | entId | The id of the entity to find. |
Returns
Type | Description |
---|---|
Entity | An instance of Entity representing the requested entity. Null if no such entity was found. |
Remarks
Only returns networked entities.
GetEntityInfo(String)
Returns the registration information of the entity identified by its registration name.
Declaration
public EntityInfo? GetEntityInfo(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The registration name of the entity. |
Returns
Type | Description |
---|---|
System.Nullable<EntityInfo> | If the requested entity was found, an EntityInfo instance containing the information of the registered entity. Null if the requested entity was not found. |
SpawnEntity(Nullable<UInt32>, String, Boolean, Vector3, Quaternion)
Spawns an entity in the current scene.
Declaration
public Entity SpawnEntity(uint? entId, string entName, bool hasAuthority, Vector3 entPos = null, Quaternion entRot = null)
Parameters
Type | Name | Description |
---|---|---|
System.Nullable<System.UInt32> | entId | The id of the entity to spawn. If null, the entity will be clientside. |
System.String | entName | The registration name of the entity to spawn. |
System.Boolean | hasAuthority | The authority of the entity to spawn. True if the entity will have local authority, False otherwise. |
Vector3 | entPos | The initial position of the entity to spawn. |
Quaternion | entRot | The initial rotation of the entity to spawn. |
Returns
Type | Description |
---|---|
Entity | An instance of Entity representing the spawned entity. |