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:
Inheritance graph
[legend]
Collaboration diagram for ControllerComponent:
Collaboration graph
[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
 
TransformComponenttransform
 

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
_transformthe position of the containing GameObject
See also
TransformComponent
Parameters
deltaPoshow much the position changes given input

◆ ~ControllerComponent()

ControllerComponent::~ControllerComponent ( )

Destroy the Controller Component object.

Member Function Documentation

◆ ComponentTypeName()

const char * ControllerComponent::ComponentTypeName ( )
inlineoverridevirtual

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)
overridevirtual

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 
)
overridevirtual

Uses any input in the SDL_Event to move the GameObject.

Parameters
echecked for any controller input
frameirrelevant for this implementation
broadcastListirrelevant 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: