Banuba SDK
Instance Methods | List of all members
BNBEntity Class Reference

#import <BNBEntity.h>

Inheritance diagram for BNBEntity:

Instance Methods

(void) - setName:
 Set a new name to the entity. More...
 
(nonnull NSString *) - getName
 
(void) - addChild:
 add entiy as child to hierarchy More...
 
(void) - removeChild:
 remove entiy as child to hierarchy More...
 
(nonnull NSArray< BNBEntity * > *) - getChildren
 get all child entites list. More...
 
(void) - clearChildren
 remove all child entites list. More...
 
(nullable BNBEntity *) - findChildByName:
 Perform depth-first traverse of entity tree. More...
 
(nullable BNBEntity *) - getParent
 
(void) - setActive:
 Set enable/disable entity flag. More...
 
(BOOL) - isActive
 
(void) - addIntoLayer:
 Add entity for given layer if it is wasn't added before. More...
 
(void) - removeFromLayer:
 Removes entity from given layer if it is was added before. More...
 
(nonnull NSArray< BNBLayer * > *) - getLayers
 returns list of layers in which entity was added. More...
 
(void) - addComponent:
 add given component to entity if component of given type wasn't added before. More...
 
(BOOL) - hasComponent:
 check if component of given type was added. More...
 
(nullable BNBComponent *) - getComponent:
 get component of given type. More...
 
(void) - removeComponent:
 remove given component to entity if component of given component was added before. More...
 

Detailed Description

Definition at line 36 of file BNBEntity.h.

Method Documentation

◆ addChild:

- (void) addChild: (nullable BNBEntity *)  child

add entiy as child to hierarchy

Parameters
child(entity): child entity.

◆ addComponent:

- (void) addComponent: (nullable BNBComponent *)  component

add given component to entity if component of given type wasn't added before.

Parameters
component(component): component to add.

◆ addIntoLayer:

- (void) addIntoLayer: (nullable BNBLayer *)  layer

Add entity for given layer if it is wasn't added before.

Parameters
layer(layer): layer to add.

◆ clearChildren

- (void) clearChildren

remove all child entites list.

◆ findChildByName:

- (nullable BNBEntity *) findChildByName: (nonnull NSString *)  entityName

Perform depth-first traverse of entity tree.

Return first found child with name entityName or NULL if such an entity doesn't exist.

Parameters
entityName(string): name of desired entity
Returns
found entity (entity) or null

◆ getChildren

- (nonnull NSArray<BNBEntity *> *) getChildren

get all child entites list.

◆ getComponent:

- (nullable BNBComponent *) getComponent: (BNBComponentType)  type

get component of given type.

Parameters
component_type(component_type): component type to get.
Returns
component of given type (component)

◆ getLayers

- (nonnull NSArray<BNBLayer *> *) getLayers

returns list of layers in which entity was added.

◆ getName

- (nonnull NSString *) getName
Returns
entity name (string)

◆ getParent

- (nullable BNBEntity *) getParent
Returns
parent entity and null if given entity is root.

◆ hasComponent:

- (BOOL) hasComponent: (BNBComponentType)  type

check if component of given type was added.

Parameters
component_type(component_type): component type to check.
Returns
flag (bool)

◆ isActive

- (BOOL) isActive
Returns
activity flag (bool)

◆ removeChild:

- (void) removeChild: (nullable BNBEntity *)  child

remove entiy as child to hierarchy

Parameters
child(entity): child entity.

◆ removeComponent:

- (void) removeComponent: (nullable BNBComponent *)  component

remove given component to entity if component of given component was added before.

Parameters
component(component): component to remove.

◆ removeFromLayer:

- (void) removeFromLayer: (nullable BNBLayer *)  layer

Removes entity from given layer if it is was added before.

@params layer (layer): layer from remove.

◆ setActive:

- (void) setActive: (BOOL)  active

Set enable/disable entity flag.

The disabling of the entity is equivalent to removing the entity and all its children from the hierarchy.

Parameters
active(bool) activity flag.

◆ setName:

- (void) setName: (nonnull NSString *)  name

Set a new name to the entity.

Name could be empty.

Parameters
name(string): new entity name.

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