Jagguar Game Engine
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
Component Class Reference

#include <Component.hpp>

Inheritance diagram for Component:
Inheritance graph
[legend]

Public Member Functions

 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)
 

Protected Attributes

std::vector< ComponentTag > tags
 
std::vector< std::string > previousBroadcasts
 
std::vector< std::string > pendingBroadcasts
 

Detailed Description

Virtual class for all components to inherit from. Contains all the functionality for Game Objects.

See also
GameObject

Constructor & Destructor Documentation

◆ Component()

Component::Component ( )

Construct a new Component object

◆ ~Component()

Component::~Component ( )

Destroy the Component object

Member Function Documentation

◆ ComponentTypeName()

virtual const char * Component::ComponentTypeName ( )
inlinevirtual

The name of the component type. Used by the GUI

See also
GameMakerGUI::CreateComponent()
Returns
the name of the component

Reimplemented in ControllerComponent, HealthComponent, RigidbodyComponent, SpriteComponent, TileMapComponent, and TransformComponent.

Here is the caller graph for this function:

◆ HasTag()

bool Component::HasTag ( ComponentTag  t)
virtual

Checks if the component has the given tag

Parameters
tthe tag to be checked
Returns
true if the component has t

◆ ParseAndUpdateBroadcast()

void Component::ParseAndUpdateBroadcast ( std::vector< std::string >  broadcastList)

Communicate with other components. Removes previous broadcasts by this Component and adds any new ones. Reads any relevant broadcasts from other Components.

Parameters
broadcastListthe persistent list of broadcasts
See also
Update()
Here is the caller graph for this function:

◆ Render()

void Component::Render ( SDL_Renderer *  ren)
virtual

Renders the component (if it has anything to render)

Parameters
renthe SDL renderer to be displayed upon
See also
IGraphicsEngineRenderer

Reimplemented in HealthComponent, ProjectileComponent, SpriteComponent, TileMapComponent, and TransformComponent.

◆ ShowComponentEditor()

void Component::ShowComponentEditor ( bool *  showEditor)
virtual

Using Imgui, render an editor for this component

See also
GameMakerGUI::RenderEditor()
Parameters
showEditor

Reimplemented in ControllerComponent, HealthComponent, RigidbodyComponent, SpriteComponent, TileMapComponent, and TransformComponent.

Here is the caller graph for this function:

◆ Update()

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

Updates the state of the component object. Called by the Engine every tick

Parameters
eany inputs given by the user
framewhat frame is the game currently displaying
broadcastLista list to be used to send messages between components
See also
ParseAndUpdateBroadcast()

Reimplemented in ControllerComponent, ProjectileComponent, RigidbodyComponent, SpriteComponent, TileMapComponent, TransformComponent, and HealthComponent.


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