#import <BNBEntity.h>
Definition at line 36 of file BNBEntity.h.
◆ addChild:
- (void) addChild: |
|
(nullable BNBEntity *) |
child |
|
add entiy as child to hierarchy
- Parameters
-
child | (entity): child entity. |
◆ addComponent:
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
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
- 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
- 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: