CS4850 Final Project
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
Component Struct Referenceabstract

Base class for all components. More...

#include <Component.hpp>

Inheritance diagram for Component:
Collision2DComponent TextureComponent TransformComponent

Public Member Functions

virtual void Input (float deltaTime)
 Handle input.
 
virtual void Update (float deltaTime)
 Update the game state.
 
virtual void Render (SDL_Renderer *renderer)
 Render the game.
 
virtual ComponentType GetType ()=0
 Get the type of the component.
 
void SetGameEntity (std::shared_ptr< GameEntity > gameEntity)
 Set the game entity that the component is attached to.
 
std::shared_ptr< GameEntityGetGameEntity ()
 Get the game entity that the component is attached to.
 

Protected Attributes

std::shared_ptr< GameEntitymGameEntity
 

Detailed Description

Base class for all components.

Member Function Documentation

◆ GetGameEntity()

std::shared_ptr< GameEntity > Component::GetGameEntity ( )
inline

Get the game entity that the component is attached to.

Returns
std::shared_ptr<GameEntity>

◆ GetType()

virtual ComponentType Component::GetType ( )
pure virtual

Get the type of the component.

Returns
ComponentType

Implemented in Collision2DComponent, TextureComponent, and TransformComponent.

◆ Input()

virtual void Component::Input ( float deltaTime)
inlinevirtual

Handle input.

Parameters
deltaTimeTime since last frame

Reimplemented in Collision2DComponent, TextureComponent, and TransformComponent.

◆ Render()

virtual void Component::Render ( SDL_Renderer * renderer)
inlinevirtual

Render the game.

Parameters
rendererSDL renderer

Reimplemented in Collision2DComponent, TextureComponent, and TransformComponent.

◆ SetGameEntity()

void Component::SetGameEntity ( std::shared_ptr< GameEntity > gameEntity)
inline

Set the game entity that the component is attached to.

Parameters
gameEntityGame entity

◆ Update()

virtual void Component::Update ( float deltaTime)
inlinevirtual

Update the game state.

Parameters
deltaTimeTime since last frame

Reimplemented in Collision2DComponent, TextureComponent, and TransformComponent.


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