EntityManager
Extends:
Static Method Summary
| Static Public Methods | ||
| public static |
|
|
| public static |
getSchema(): {"nextUid": *} |
|
Constructor Summary
| Public Constructor | ||
| public |
|
|
Member Summary
| Public Members | ||
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
Method Summary
| Public Methods | ||
| public |
attachDynamicComponent(entity: Entity, component: Component) Call to attach a new component after the creation of the entity |
|
| public |
destroyEntity(entity: Entity) Queues an entity for destruction |
|
| public |
Finds an entity buy its uid, kinda slow since it loops over all entities |
|
| public |
Generates a new uid |
|
| public |
getAllWithComponent(componentHandle: typeof Component): Array<Entity> Returns all entities having the given component |
|
| public |
Returns a map which gives a mapping from UID to Entity. |
|
| public |
getStatsText(): * |
|
| public |
|
|
| public |
registerEntity(entity: Entity, uid: number=) Registers a new entity |
|
| public |
removeDynamicComponent(entity: Entity, component: typeof Component) Call to remove a component after the creation of the entity |
|
| public |
unregisterEntityComponents(entity: Entity) Unregisters all components of an entity from the component to entity mapping |
|
| public |
update() |
|
Inherited Summary
| From class BasicSerializableObject | ||
| public static |
|
|
| public static |
getId() |
|
| public static |
Should return the serialization schema |
|
| public static |
|
|
| public |
deserialize(data: any, root: import("./savegame_serializer").GameRoot): string | void |
|
| public |
|
|
Static Public Methods
public static getSchema(): {"nextUid": *} source
Should return the serialization schema
Override:
BasicSerializableObject#getSchemaReturn:
| {"nextUid": *} |
Public Constructors
public constructor() source
Fixes typeof DerivedComponent is not assignable to typeof Component, compiled out in non-dev builds
Override:
BasicSerializableObject#constructorPublic Members
Public Methods
public attachDynamicComponent(entity: Entity, component: Component) source
Call to attach a new component after the creation of the entity
public destroyEntity(entity: Entity) source
Queues an entity for destruction
Params:
| Name | Type | Attribute | Description |
| entity | Entity |
public findByUid(uid: number, errorWhenNotFound: boolean=): Entity source
Finds an entity buy its uid, kinda slow since it loops over all entities
Params:
| Name | Type | Attribute | Description |
| uid | number | ||
| errorWhenNotFound | boolean= |
public getAllWithComponent(componentHandle: typeof Component): Array<Entity> source
Returns all entities having the given component
Params:
| Name | Type | Attribute | Description |
| componentHandle | typeof Component |
public getFrozenUidSearchMap(): Map<number, Entity> source
Returns a map which gives a mapping from UID to Entity. This map is not updated.
public processDestroyList() source
public registerEntity(entity: Entity, uid: number=) source
Registers a new entity
Params:
| Name | Type | Attribute | Description |
| entity | Entity | ||
| uid | number= | Optional predefined uid |
public removeDynamicComponent(entity: Entity, component: typeof Component) source
Call to remove a component after the creation of the entity
Params:
| Name | Type | Attribute | Description |
| entity | Entity | ||
| component | typeof Component |
public unregisterEntityComponents(entity: Entity) source
Unregisters all components of an entity from the component to entity mapping
Params:
| Name | Type | Attribute | Description |
| entity | Entity |
