Peoplemon  0.1.0
Peoplemon 3 game source documentation
Classes | Public Member Functions | List of all members
core::component::WanderBehavior Class Reference

Add this component to an entity to make it wander around. More...

#include <WanderBehavior.hpp>

Public Member Functions

 WanderBehavior (unsigned int radius, const sf::Vector2i &origin)
 Construct a new Wander Behavior component. More...
 
void update (bl::tmap::Position &position, Controllable &controller, float dt)
 Updates the entity and wanders around. More...
 

Detailed Description

Add this component to an entity to make it wander around.

Definition at line 18 of file WanderBehavior.hpp.

Constructor & Destructor Documentation

◆ WanderBehavior()

core::component::WanderBehavior::WanderBehavior ( unsigned int  radius,
const sf::Vector2i &  origin 
)

Construct a new Wander Behavior component.

Parameters
radiusThe radius to stay within, in tiles
originThe starting position, in tiles

Definition at line 10 of file WanderBehavior.cpp.

Member Function Documentation

◆ update()

void core::component::WanderBehavior::update ( bl::tmap::Position &  position,
Controllable controller,
float  dt 
)

Updates the entity and wanders around.

Parameters
positionThe position of the entity
controllerThe controllable of the entity
dtTime elapsed, in seconds

Definition at line 19 of file WanderBehavior.cpp.


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