Options
All
  • Public
  • Public/Protected
  • All
Menu

Class EntityRepository

The class that generates and manages entities.

Hierarchy

  • EntityRepository

Index

Constructors

Properties

__entities: IEntity[] = []
__entity_uid_count: number = Entity.invalidEntityUID
_components: Map<number, Component>[] = []

Methods

  • addComponentToEntity<ComponentType, EntityType>(componentClass: ComponentType, entity: EntityType): EntityType & IsThisSparkGear<ComponentType, IsThisEffekseer<ComponentType, IsThisPhysics<ComponentType, IsThisBlendShape<ComponentType, IsThisSkeletal<ComponentType, IsThisLight<ComponentType, IsThisCamera<ComponentType, IsThisCameraController<ComponentType, IsThisMeshRenderer<ComponentType, IsThisMesh<ComponentType, IsThisSceneGraph<ComponentType, IsThisTransform<ComponentType, IsThisAnimation<ComponentType, AllWellKnownComponentMethodsTypes>>>>>>>>>>>>>
  • Add a Component to the entity

    Type Parameters

    Parameters

    • componentClass: ComponentType

      a ComponentClass to add

    • entity: EntityType

      the entity

    Returns EntityType & IsThisSparkGear<ComponentType, IsThisEffekseer<ComponentType, IsThisPhysics<ComponentType, IsThisBlendShape<ComponentType, IsThisSkeletal<ComponentType, IsThisLight<ComponentType, IsThisCamera<ComponentType, IsThisCameraController<ComponentType, IsThisMeshRenderer<ComponentType, IsThisMesh<ComponentType, IsThisSceneGraph<ComponentType, IsThisTransform<ComponentType, IsThisAnimation<ComponentType, AllWellKnownComponentMethodsTypes>>>>>>>>>>>>>

    the entity added a component

  • getComponentOfEntity(entityUid: number, componentType: typeof Component): null | Component
  • getEntitiesNumber(): number
  • getEntity(entityUid: number): IEntity
  • getEntityByUniqueName(uniqueName: string): undefined | IEntity
  • Remove components from the entity. Note: the returned entity's type will be IEntity (most basic type). You have to cast it to appropriate type later.

    Parameters

    • componentClass: typeof Component

      The class object of the component to remove.

    • entity: IEntity

    Returns IEntity

Generated using TypeDoc