#include <tb_entity_behavior_interface.h>
The EntityBehaviorInterface provides an interface to create small behavioral states for an Entity that can be reused and applied on the Entity's behavior stack.
TurtleBrains::Game::EntityBehaviorInterface::EntityBehaviorInterface |
( |
Entity & |
entity | ) |
|
|
explicit |
Constructs an entity behavior.
virtual TurtleBrains::Game::EntityBehaviorInterface::~EntityBehaviorInterface |
( |
void |
| ) |
|
|
pure virtual |
Destructs an entity behavior which currently (TurtleBrains v0.2.0) does not have any resources to clean up after.
virtual void TurtleBrains::Game::EntityBehaviorInterface::OnAdded |
( |
void |
| ) |
|
|
protectedvirtual |
This is invoked when the behavior is pushed onto the entities behavior stack, pausing the currently active behavior. This behavior is now the active behavior and will be paused if that changes.
virtual void TurtleBrains::Game::EntityBehaviorInterface::OnCollideWith |
( |
const Entity & |
other | ) |
|
|
protectedvirtual |
This is invoked when the Entity collides/intersects another entity and the behavior is at the top of the entities behavior stack.
virtual void TurtleBrains::Game::EntityBehaviorInterface::OnPaused |
( |
void |
| ) |
|
|
protectedvirtual |
This is invoked when the behavior is currently active and a new behavior gets pushed on becoming the new active behavior. OnResume() will be invoked once the behavior becomes active once again.
virtual void TurtleBrains::Game::EntityBehaviorInterface::OnRemoved |
( |
void |
| ) |
|
|
protectedvirtual |
This is invoked just as the behavior is being removed from the entity stack.
virtual void TurtleBrains::Game::EntityBehaviorInterface::OnRender |
( |
void |
| ) |
const |
|
protectedvirtual |
This is invoked when the Entity is visible and rendered and when the behavior is at the top of the entities behavior stack. Called exactly once per frame.
virtual void TurtleBrains::Game::EntityBehaviorInterface::OnResume |
( |
void |
| ) |
|
|
protectedvirtual |
This is invoked when the behavior is currently paused and the active behavior gets popped off the stack letting this behavior become active again.
virtual void TurtleBrains::Game::EntityBehaviorInterface::OnSimulate |
( |
void |
| ) |
|
|
protectedvirtual |
virtual void TurtleBrains::Game::EntityBehaviorInterface::OnUpdate |
( |
const float |
deltaTime | ) |
|
|
protectedvirtual |
This is invoked when the Entity is activated and updated and when the behavior is at the top of the entities behavior stack. Called exactly once per frame.
Entity& TurtleBrains::Game::EntityBehaviorInterface::mEntity |
|
protected |
The Entity which the behavior should work magic on. Some behaviors may need a more specific Entity reference and that should be held and contained. For instance a behavior specific to a PlayerEntity would contain PlayerEntity& mPlayerEntity; and work the specific magic on the player.