Simple C++ Game
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
VelocityComponent Class Reference

A component for storing the 2D velocity of an entity. More...

#include <Components.hpp>

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

Public Member Functions

 VelocityComponent ()
 Construct a new Velocity Component object. More...
 
- Public Member Functions inherited from Entity::Component
 Component (const std::string id)
 Construct a new Component object. More...
 
virtual ~Component ()
 This is only declared to make the class polymorphic so that dymaic_cast between Component types works.
 
const std::string getId () const
 Get the ID of the component. This will return the same value for all instances of a class of Component.
 

Public Attributes

sf::Vector2f velocity
 The entity's velocity.
 

Static Public Attributes

static const std::string VEL_COMP_ID
 The ID of a VelocityComponent.
 

Detailed Description

A component for storing the 2D velocity of an entity.

Constructor & Destructor Documentation

◆ VelocityComponent()

VelocityComponent::VelocityComponent ( )

Construct a new Velocity Component object.

The velocity defaults to (0, 0)


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