#include <tb_entity_behavior_interface.hpp>
Public Member Functions | |
EntityBehaviorInterface (Entity &entity) | |
virtual | ~EntityBehaviorInterface (void)=0 |
Protected Member Functions | |
virtual void | OnAdd (void) |
virtual void | OnRemove (void) |
virtual void | OnPause (void) |
virtual void | OnResume (void) |
virtual void | OnSimulate (void) |
virtual void | OnUpdate (const float deltaTime) |
virtual void | OnRender (void) const |
virtual void | OnCollide (const Entity &withOther) |
Protected Attributes | |
Entity & | mEntity |
Friends | |
class | Entity |
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.
|
explicit |
Constructs an entity behavior.
|
pure virtual |
Destructs an entity behavior which currently (TurtleBrains v0.2.0) does not have any resources to clean up after.
|
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.
|
protectedvirtual |
This is invoked when the Entity collides/intersects another entity and the behavior is at the top of the entities behavior stack.
|
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.
|
protectedvirtual |
This is invoked just as the behavior is being removed from the entity stack.
Reimplemented in TurtleBrainsExpress::Behaviors::TranslateToBehavior, TurtleBrainsExpress::Behaviors::RotateTweenBehavior, TurtleBrainsExpress::Behaviors::FlickerForBehavior, TurtleBrainsExpress::Behaviors::ScaleTweenBehavior, TurtleBrainsExpress::Behaviors::TweeningBehavior< Type >, TurtleBrainsExpress::Behaviors::TweeningBehavior< tbMath::Vector2 >, TurtleBrainsExpress::Behaviors::TweeningBehavior< float >, and TurtleBrainsExpress::Behaviors::TranslateTweenBehavior.
|
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.
|
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.
Reimplemented in TurtleBrainsExpress::Behaviors::FadeColorBehavior, TurtleBrainsExpress::Behaviors::ShakeScreenBehavior, TurtleBrainsExpress::Behaviors::RotateTweenBehavior, TurtleBrainsExpress::Behaviors::ScaleTweenBehavior, TurtleBrainsExpress::Behaviors::PlaySoundBehavior, TurtleBrainsExpress::Behaviors::TranslateTweenBehavior, and TurtleBrainsExpress::Behaviors::PlayAnimationBehavior.
|
protectedvirtual |
This is invoked when the Entity is activated and simulated and when the behavior is at the top of the entities behavior stack. Called 0 to N times per frame.
Reimplemented in TurtleBrainsExpress::Behaviors::FadeColorBehavior, TurtleBrainsExpress::Behaviors::TranslateForBehavior, TurtleBrainsExpress::Behaviors::RotateForBehavior, TurtleBrainsExpress::Behaviors::ShakeScreenBehavior, TurtleBrainsExpress::Behaviors::RotateTweenBehavior, TurtleBrainsExpress::Behaviors::TranslateToBehavior, TurtleBrainsExpress::Behaviors::ScaleTweenBehavior, TurtleBrainsExpress::Behaviors::FlickerForBehavior, TurtleBrainsExpress::Behaviors::PlaySoundBehavior, TurtleBrainsExpress::Behaviors::TweeningBehavior< Type >, TurtleBrainsExpress::Behaviors::TweeningBehavior< tbMath::Vector2 >, TurtleBrainsExpress::Behaviors::TweeningBehavior< float >, TurtleBrainsExpress::Behaviors::TranslateTweenBehavior, TurtleBrainsExpress::Behaviors::RotateToBehavior, TurtleBrainsExpress::Behaviors::KillBehavior, TurtleBrainsExpress::Behaviors::PlayAnimationBehavior, TurtleBrainsExpress::Behaviors::ScaleToBehavior, TurtleBrainsExpress::Behaviors::RotateBehavior, TurtleBrainsExpress::Behaviors::TranslateBehavior, and TurtleBrainsExpress::Behaviors::DelayBehavior.
|
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.
|
protected |