Building Game Engines
Public Member Functions | Static Public Attributes | List of all members
TransformComponent Class Reference

#include <TransformComponent.hpp>

Inheritance diagram for TransformComponent:
Inheritance graph
Collaboration diagram for TransformComponent:
Collaboration graph

Public Member Functions

 TransformComponent ()
 
 ~TransformComponent ()
 
virtual void Update ()
 
virtual void Render (SDL_Renderer *renderer)
 
std::pair< double, double > GetPosition ()
 
std::pair< double, double > GetVelocity ()
 
std::pair< int, int > GetDimensions ()
 
void SetPosition (double x, double y)
 
void SetVelocity (double x, double y)
 
void SetVelocityX (double x)
 
void SetVelocityY (double y)
 
void SetWidth (int w)
 
void SetHeight (int h)
 
- Public Member Functions inherited from Component
 Component ()
 
virtual ~Component ()=0
 

Static Public Attributes

static const int hash = 10
 

Detailed Description

A component to give a game object the ability to transform

Constructor & Destructor Documentation

◆ TransformComponent()

TransformComponent::TransformComponent ( )

Constructor

◆ ~TransformComponent()

TransformComponent::~TransformComponent ( )

Destructor

Member Function Documentation

◆ GetDimensions()

std::pair< int, int > TransformComponent::GetDimensions ( )

Gets the dimensions of the game object this component is attached to

◆ GetPosition()

std::pair< double, double > TransformComponent::GetPosition ( )

Gets the position of the game object this component is attached to

◆ GetVelocity()

std::pair< double, double > TransformComponent::GetVelocity ( )

Gets the velocity of the game object this component is attached to

◆ Render()

void TransformComponent::Render ( SDL_Renderer *  renderer)
virtual

Does nothing

Implements Component.

◆ SetHeight()

void TransformComponent::SetHeight ( int  h)

Sets the height of the game object this component is attached to

◆ SetPosition()

void TransformComponent::SetPosition ( double  x,
double  y 
)

Sets the position of the game object this component is attached to

◆ SetVelocity()

void TransformComponent::SetVelocity ( double  x,
double  y 
)

Sets the velocity of the game object this component is attached to

◆ SetVelocityX()

void TransformComponent::SetVelocityX ( double  x)

Sets the x velocity of the game object this component is attached to

◆ SetVelocityY()

void TransformComponent::SetVelocityY ( double  y)

Sets the y velocity of the game object this component is attached to

◆ SetWidth()

void TransformComponent::SetWidth ( int  w)

Sets the width of the game object this component is attached to

◆ Update()

void TransformComponent::Update ( )
virtual

Updates the position and velocity of the game object this component is attached to

Implements Component.

Member Data Documentation

◆ hash

const int TransformComponent::hash = 10
static

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