Jagguar Game Engine

Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
ControllerComponent Class Reference

`#include <ControllerComponent.hpp>`

Inheritance diagram for ControllerComponent:
[legend]
Collaboration diagram for ControllerComponent:
[legend]

## Public Member Functions
| ControllerComponent (TransformComponent *_transform, Vec2D deltaPos)
| ~ControllerComponent ()
void | Update (SDL_Event e, int frame, std::vector< std::string > broadcastList) override
void | ShowComponentEditor (bool *showEditor) override
const char * | ComponentTypeName () override
Public Member Functions inherited from Component
| Component ()
| ~Component ()
virtual void | Update (SDL_Event e, int frame, std::vector< std::string > broadcastList)
virtual void | Render (SDL_Renderer *ren)
virtual void | ShowComponentEditor (bool *showEditor)
virtual bool | HasTag (ComponentTag t)
virtual const char * | ComponentTypeName ()
void | ParseAndUpdateBroadcast (std::vector< std::string > broadcastList)

## Private Attributes
Vec2D | deltaPos
TransformComponent * | transform

## Additional Inherited Members
Protected Attributes inherited from Component
std::vector< ComponentTag > | tags
std::vector< std::string > | previousBroadcasts
std::vector< std::string > | pendingBroadcasts

## Detailed Description

Allows a GameObject to be controlled via player input.

## Constructor & Destructor Documentation

## ◆ ControllerComponent()

ControllerComponent::ControllerComponent | ( | TransformComponent * | _transform,
|  | Vec2D | deltaPos
| ) |  |

Construct a new Controller Component object,

Parameters

  _transform | the position of the containing GameObject

See also
  TransformComponent

Parameters

  deltaPos | how much the position changes given input

## ◆ ~ControllerComponent()

ControllerComponent::~ControllerComponent | ( |  | ) |

Destroy the Controller Component object.

## Member Function Documentation

## ◆ ComponentTypeName()

const char * ControllerComponent::ComponentTypeName | ( |  | ) |
| inline override virtual

The name of the component type. Used by the GUI

See also
  GameMakerGUI::CreateComponent()

Returns
  the name of the component

Reimplemented from Component.

## ◆ ShowComponentEditor()

void ControllerComponent::ShowComponentEditor | ( | bool * | showEditor | ) |
| override virtual

Using Imgui, render an editor for this component

See also
  GameMakerGUI::RenderEditor()

Parameters

  showEditor |

Reimplemented from Component.

## ◆ Update()

void ControllerComponent::Update | ( | SDL_Event | e,
|  | int | frame,
|  | std::vector< std::string > | broadcastList
| ) |  |
| override virtual

Uses any input in the SDL_Event to move the GameObject.

Parameters

  e | checked for any controller input
  frame | irrelevant for this implementation
  broadcastList | irrelevant for this implementation

Reimplemented from Component.

Here is the call graph for this function:

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

- include/ControllerComponent.hpp
- src/ControllerComponent.cpp