CitroFlex3ds 0.1
CitroFlex3DS is a lightweight game engine designed specifically for Nintendo 3DS homebrew development. It provides a simple framework for creating games and applications.
 
Loading...
Searching...
No Matches
Objects::Object Class Reference

Base abstract class for all Scene objects Cannot be instantiated directly due to pure virtual methods. More...

#include <Objects.hpp>

Inheritance diagram for Objects::Object:
Objects::Circle Objects::Ellipse Objects::Line Objects::Rectangle Objects::Sprite Player ReturnButton

Public Member Functions

double get_x ()
 Get the X position.
 
void SetX (double new_x)
 Set the X position.
 
void AddX (double add_x)
 Add to the X position.
 
double get_y ()
 Get the Y position.
 
void SetY (double new_y)
 Set the Y position.
 
void AddY (double add_y)
 Add to the Y position.
 
virtual void Init ()
 Initialize the object.
 
virtual void Update (Scene::Scene *scene)
 Update and draw the object.
 
void UpdateAttached ()
 Updates the objects attached to this instance.
 
void Attach (Object *obj)
 Attach an object to this object and set its relative position.
 
void SetScene (Scene::Scene *scene)
 Setter for the currentscene (called by the Scene instance)
 
Scene::Scene * GetScene () const
 Getter for the currentscene (called by the Scene instance)
 
void SetInputManager (Input::InputManager *manager)
 Setter for the inputmanager (called by the Scene instance)
 

Public Attributes

bool visible = true
 
std::vector< Objects::Object * > attachedElements
 
Object * parent = nullptr
 
int id = -1
 

Protected Member Functions

virtual void OnUpdate (Scene::Scene *scene)
 Custom update logic (can be override to add custom logic before Drawing)
 
Input::InputManager * GetInputManager () const
 Getter for the InputManager.
 

Detailed Description

Base abstract class for all Scene objects Cannot be instantiated directly due to pure virtual methods.

Member Function Documentation

◆ AddX()

void Object::AddX ( double add_x)

Add to the X position.

Parameters
add_xValue to add to X

◆ AddY()

void Object::AddY ( double add_y)

Add to the Y position.

Parameters
add_yValue to add to Y

◆ Attach()

void Object::Attach ( Object * obj)

Attach an object to this object and set its relative position.

Parameters
objObject instance to attach

◆ get_x()

double Object::get_x ( )

Get the X position.

Returns
Current X position

◆ get_y()

double Object::get_y ( )

Get the Y position.

Returns
Current Y position

◆ GetInputManager()

Input::InputManager * Objects::Object::GetInputManager ( ) const
inlineprotected

Getter for the InputManager.

Returns
InputManager instance

◆ GetScene()

Scene::Scene * Objects::Object::GetScene ( ) const
inline

Getter for the currentscene (called by the Scene instance)

Returns
Scene instance

◆ OnUpdate()

virtual void Objects::Object::OnUpdate ( Scene::Scene * scene)
inlineprotectedvirtual

Custom update logic (can be override to add custom logic before Drawing)

Parameters
sceneScene instance

Reimplemented in Player, and ReturnButton.

◆ SetInputManager()

void Objects::Object::SetInputManager ( Input::InputManager * manager)
inline

Setter for the inputmanager (called by the Scene instance)

Parameters
managerInputManager instance

◆ SetScene()

void Objects::Object::SetScene ( Scene::Scene * scene)
inline

Setter for the currentscene (called by the Scene instance)

Parameters
sceneScene instance

◆ SetX()

void Object::SetX ( double new_x)

Set the X position.

Parameters
new_xNew X position

◆ SetY()

void Object::SetY ( double new_y)

Set the Y position.

Parameters
new_yNew Y position

◆ Update()

void Object::Update ( Scene::Scene * scene)
virtual

Update and draw the object.

Parameters
scenePointer to the current scene passed by the Scene instance

Reimplemented in Objects::Circle, Objects::Ellipse, Objects::Line, Objects::Rectangle, and Objects::Sprite.


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