Harmonic Flow Framework (libhffwk)
Cross platform C++ 2D Game Engine Framework
Public Member Functions | List of all members
HFCore::ActorManager Class Reference

Interface for handling Actor's. More...

#include <ActorManager.h>

Public Member Functions

void add (Actor *actor)
 Add Actor to internal vector. More...
 
void remove (Actor *actor)
 Remove Actor from internal vector. More...
 
void update (fp32_hf dt)
 Called once for every iteration of the game loop, immediately before rendering takes place. More...
 
void draw (Graphics *g)
 Called once for every iteration of the main loop. More...
 

Detailed Description

Interface for handling Actor's.

ActorManager handles all Actor's and you just add() or remove() basically and make sure draw() and update() is called once per frame.

Example code:

void GameMain::draw(HFCore::Graphics *g)
{
if (!g->beginScene())
return;
// draw all actors:
HFCORE_ACTMGR->draw(g);
g->endScene();
}
void GameMain::update(fp32_hf dt)
{
// update all actors:
HFCORE_ACTMGR->update(dt);
}

Definition at line 69 of file ActorManager.h.

Member Function Documentation

◆ add()

void ActorManager::add ( Actor actor)

Add Actor to internal vector.

Parameters
actorActor to add to internal vector.

Definition at line 39 of file ActorManager.cpp.

◆ draw()

void ActorManager::draw ( Graphics g)

Called once for every iteration of the main loop.

Implementations should draw themselves using the Graphics object on every call to this method

Parameters
gPointer to Graphics object.

Definition at line 72 of file ActorManager.cpp.

◆ remove()

void ActorManager::remove ( Actor actor)

Remove Actor from internal vector.

Parameters
actorActor to remove from internal vector.

Definition at line 45 of file ActorManager.cpp.

◆ update()

void ActorManager::update ( fp32_hf  dt)

Called once for every iteration of the game loop, immediately before rendering takes place.

Parameters
dtAmount of time that's passed since the last call.

Definition at line 59 of file ActorManager.cpp.


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