TurtleBrains  0.2.1
High quality, portable, C++ API for native application and game development.
TurtleBrains::Game::DelayBehavior Class Reference

#include <tb_entity_behavior_interface.h>

Inheritance diagram for TurtleBrains::Game::DelayBehavior:
TurtleBrains::Game::EntityBehaviorInterface TurtleBrains::Core::Noncopyable

Public Member Functions

 DelayBehavior (Entity &entity, const tbGame::GameTimer &delayTimer)
 
virtual ~DelayBehavior (void)
 
virtual void OnSimulate (void)
 
- Public Member Functions inherited from TurtleBrains::Game::EntityBehaviorInterface
 EntityBehaviorInterface (Entity &entity)
 
virtual ~EntityBehaviorInterface (void)=0
 

Additional Inherited Members

- Protected Member Functions inherited from TurtleBrains::Game::EntityBehaviorInterface
virtual void OnAdded (void)
 
virtual void OnRemoved (void)
 
virtual void OnPaused (void)
 
virtual void OnResume (void)
 
virtual void OnUpdate (const float deltaTime)
 
virtual void OnRender (void) const
 
virtual void OnCollideWith (const Entity &other)
 
- Protected Attributes inherited from TurtleBrains::Game::EntityBehaviorInterface
EntitymEntity
 

Detailed Description

The DelayBehavior is a simple behavior that, while active, counts down a delay timer and pops the behavior off the entity's behavior stack once the timer reaches zero.

Constructor & Destructor Documentation

TurtleBrains::Game::DelayBehavior::DelayBehavior ( Entity entity,
const tbGame::GameTimer delayTimer 
)
inline

Constructs a DelayBehavior for the entity.

Parameters
entityThe entity which this behavior will be "controlling".
delayTimerThe amount of time to delay before popping the action off the entities stack.
virtual TurtleBrains::Game::DelayBehavior::~DelayBehavior ( void  )
inlinevirtual

Destructs the DelayBehavior.

Member Function Documentation

virtual void TurtleBrains::Game::DelayBehavior::OnSimulate ( void  )
virtual

Decrements the delay timer and if it reaches zero, pops the behavior off the entity's behavior stack.

Reimplemented from TurtleBrains::Game::EntityBehaviorInterface.