Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Entity

The class that represents an entity.

remarks

The Rhodonite Entity Class which are an entities that exists in space. Entities can acquire various functions by having components on themselves.

Hierarchy

Implements

Index

Constructors

  • new Entity(entityUID: number, isAlive: boolean, components?: Map<number, Component>): Entity
  • The constructor of the Entity class.

    remarks

    When creating an Entity, use the createEntity method of the EntityRepository class instead of directly calling this constructor.

    Parameters

    • entityUID: number

      The unique ID of the entity

    • isAlive: boolean

      Whether this entity alive or not

    • Optional components: Map<number, Component>

    Returns Entity

Properties

__components: Map<number, Component>

The Map of components. All components must be managed in this map

__entity_uid: number

The Unique ID of Entity

_isAlive: boolean

No use yet

InvalidObjectUID: -1 = -1
currentMaxObjectCount: number = 0
invalidEntityUID: -1 = -1

Invalid Entity UID constant value

Accessors

  • get entityUID(): number
  • get objectUID(): number
  • get uniqueName(): string

Methods

  • _removeComponent(componentTID: number): void
  • destroy(): void
  • getComponentByComponentTID(componentTID: number): undefined | Component
  • getTag(tagName: string): Tag
  • getTagValue(tagName: string): any
  • hasComponent(componentType: typeof Component): boolean
  • hasTag(tagName: string): boolean
  • matchTag(tagName: string, tagValue: string): boolean
  • matchTags(tags: RnTags): boolean
  • matchTagsAsFreeStrings(stringArray: string[]): boolean
  • removeTag(tagName: string): void
  • tryToSetTag(tag: Tag): boolean
  • tryToSetUniqueName(name: string, toAddNameIfConflict: boolean): boolean
  • validateTagString(val: string): boolean
  • _reset(): void
  • getRnObject(objectUid: number): RnObject
  • getRnObjectByName(uniqueName: string): undefined | RnObject
  • searchByTag(tag: string, value: string): undefined | RnObject

Generated using TypeDoc