Base abstract class for all Scene objects Cannot be instantiated directly due to pure virtual methods. More...
#include <Objects.hpp>
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. | |
Base abstract class for all Scene objects Cannot be instantiated directly due to pure virtual methods.
| void Object::AddX | ( | double | add_x | ) |
Add to the X position.
| add_x | Value to add to X |
| void Object::AddY | ( | double | add_y | ) |
Add to the Y position.
| add_y | Value to add to Y |
| void Object::Attach | ( | Object * | obj | ) |
Attach an object to this object and set its relative position.
| obj | Object instance to attach |
| double Object::get_x | ( | ) |
Get the X position.
| double Object::get_y | ( | ) |
Get the Y position.
|
inlineprotected |
Getter for the InputManager.
|
inline |
Getter for the currentscene (called by the Scene instance)
|
inlineprotectedvirtual |
Custom update logic (can be override to add custom logic before Drawing)
| scene | Scene instance |
Reimplemented in Player, and ReturnButton.
|
inline |
Setter for the inputmanager (called by the Scene instance)
| manager | InputManager instance |
|
inline |
Setter for the currentscene (called by the Scene instance)
| scene | Scene instance |
| void Object::SetX | ( | double | new_x | ) |
Set the X position.
| new_x | New X position |
| void Object::SetY | ( | double | new_y | ) |
Set the Y position.
| new_y | New Y position |
|
virtual |
Update and draw the object.
| scene | Pointer to the current scene passed by the Scene instance |
Reimplemented in Objects::Circle, Objects::Ellipse, Objects::Line, Objects::Rectangle, and Objects::Sprite.