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

A component that stores the information about where and how large the entity is. More...

#include <Components.hpp>

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

Public Member Functions

 LocationComponent ()
 Construct a new Location 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::FloatRect location
 The location and bounds of the entity.
 

Static Public Attributes

static const std::string LOC_COMP_ID
 The ID of LocationComponent.
 

Detailed Description

A component that stores the information about where and how large the entity is.

Constructor & Destructor Documentation

◆ LocationComponent()

LocationComponent::LocationComponent ( )

Construct a new Location Component object.

The location sf::FloatRect defaults to size (0, 0) at the origin. If other values are desired, the caller must set them after initialization.


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