CS4850 Final Project
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Collision2DComponent Struct Reference

A component that represents a 2D collision box. More...

#include <Collision2DComponent.hpp>

Inheritance diagram for Collision2DComponent:
Component

Public Member Functions

ComponentType GetType () override
 Get the type of the component.
 
void Input (float deltaTime) override
 Handle input.
 
void Update (float deltaTime) override
 Update the game state.
 
void Render (SDL_Renderer *renderer) override
 Render the game.
 
void SetW (float w)
 
void SetH (float h)
 
void SetWH (float w, float h)
 
float GetW () const
 
float GetH () const
 
void SetX (float x)
 
void SetY (float y)
 
void SetXY (float x, float y)
 
float GetX () const
 
float GetY () const
 
SDL_FRect GetRectangle () const
 
- Public Member Functions inherited from 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.
 

Additional Inherited Members

- Protected Attributes inherited from Component
std::shared_ptr< GameEntitymGameEntity
 

Detailed Description

A component that represents a 2D collision box.

Member Function Documentation

◆ GetType()

ComponentType Collision2DComponent::GetType ( )
overridevirtual

Get the type of the component.

Returns
ComponentType

Implements Component.

◆ Input()

void Collision2DComponent::Input ( float deltaTime)
overridevirtual

Handle input.

Parameters
deltaTimeTime since last frame

Reimplemented from Component.

◆ Render()

void Collision2DComponent::Render ( SDL_Renderer * renderer)
overridevirtual

Render the game.

Parameters
rendererSDL renderer

Reimplemented from Component.

◆ Update()

void Collision2DComponent::Update ( float deltaTime)
overridevirtual

Update the game state.

Parameters
deltaTimeTime since last frame

Reimplemented from Component.


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