Simple C++ Game
Public Member Functions | Protected Member Functions | List of all members
VelocitySystem Class Reference

A system for updating positions based on velocities. More...

#include <VelocitySystem.hpp>

Inheritance diagram for VelocitySystem:
Inheritance graph
[legend]
Collaboration diagram for VelocitySystem:
Collaboration graph
[legend]

Public Member Functions

 VelocitySystem ()
 Construct a new VelocitySystem.
 
- Public Member Functions inherited from IteratingSystem
 IteratingSystem ()
 Construct a new IteratingSystem with the default EntitySystem constructor. More...
 
 IteratingSystem (const std::shared_ptr< EntityFamily > &family)
 Construct a new IteratingSystem with the EntityFamily EntitySystem constructor. More...
 
void update (const sf::Time deltaTime)
 Iterates through each element in the system to perform updates. More...
 
- Public Member Functions inherited from EntitySystem
 EntitySystem ()
 Construct a new default EntitySystem. More...
 
 EntitySystem (const std::shared_ptr< EntityFamily > &family)
 Construct a new EntitySystem that acts on a specified family. More...
 
virtual void engineEntityAdded (const std::shared_ptr< Entity > &entity)
 Performs any operations required after an entity has been added to an EntityEngine the system is a part of. More...
 

Protected Member Functions

void process (std::shared_ptr< Entity > &entity, sf::Time deltaTime)
 Updates position data based on velocity for an Entity. More...
 
- Protected Member Functions inherited from EntitySystem
virtual std::map< int, std::shared_ptr< Entity > > getEntities () const
 Get the Entities in the system. More...
 

Detailed Description

A system for updating positions based on velocities.

It acts on entities with LocationComponent and VelocityComponent

Member Function Documentation

◆ process()

void VelocitySystem::process ( std::shared_ptr< Entity > &  entity,
sf::Time  deltaTime 
)
protectedvirtual

Updates position data based on velocity for an Entity.

Parameters
entityThe current entity being processed
deltaTimeThe amount of time that has passed since process() was last called on this entity

Implements IteratingSystem.


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