|
Capycore Engine
0.1.0
A simple and lightweight game engine written in C++ based on the Unity API architecture.
|
Base class for renderable components in the engine. More...
#include <renderable.h>
Public Member Functions | |
| Renderable () | |
| Renderable (int layer) | |
| ~Renderable () override=default | |
| Renderable & | order_in_layer (int layer) |
| int | order_in_layer () const |
| void | set_render_strategy (Component &component) |
| virtual IRenderingStrategy & | render_strategy () const |
| std::string | type_name () const override |
| Provides a consistent type name for the component. | |
| Renderable & | disable_draw () noexcept |
| Renderable & | enable_draw () noexcept |
| bool | should_draw () const noexcept |
Public Member Functions inherited from Component | |
| Component () | |
| virtual | ~Component ()=default |
| bool | active () const noexcept |
| Checks if the component is active. | |
| Component & | active (bool value) noexcept |
| bool | marked_for_deletion () const noexcept |
| Activates the component. | |
| Component & | mark_for_deletion () noexcept |
| virtual void | update (float dt)=0 |
| virtual void | on_attach () |
| Called when the component is attached to a GameObject. | |
| virtual void | on_detach () |
| Called when the component is detached from a GameObject. | |
| virtual void | on_serialize (std::vector< uint8_t > &) const |
| Serializes the component's state into a byte array. | |
| virtual void | on_deserialize (const std::vector< uint8_t > &, size_t &) |
| Deserializes the component's state from a byte array. | |
| const std::optional< std::reference_wrapper< GameObject > > & | parent () const noexcept |
| Gets the parent GameObject of this component. | |
| std::optional< std::reference_wrapper< GameObject > > & | parent () noexcept |
| Gets the parent GameObject of this component. | |
| Component & | parent (GameObject &parent) |
| Component & | parent (std::nullopt_t nullopt) |
| size_t | add_on_attach (const std::function< void(Component &)> &action) |
| Retrieves the type information of the component. | |
| void | remove_on_attach (size_t index) |
| size_t | add_on_detach (const std::function< void(Component &)> &action) |
| Adds an action to be performed when the component is attached. | |
| void | remove_on_detach (size_t index) |
Protected Attributes | |
| std::unique_ptr< IRenderingStrategy > | render_strategy_ |
| int | ordering_layer_ = 0 |
| bool | draw {true} |
Base class for renderable components in the engine.
Renderable components are those that can be drawn on the screen using a rendering strategy. They hold a unique pointer to an IRenderingStrategy which defines how the component is rendered. This class extends the Component class and provides functionality to set and retrieve the rendering strategy.
|
explicit |
|
explicit |
|
overridedefault |
|
noexcept |
|
noexcept |
| int Renderable::order_in_layer | ( | ) | const |
| Renderable & Renderable::order_in_layer | ( | int | layer | ) |
|
virtual |
| void Renderable::set_render_strategy | ( | Component & | component | ) |
|
noexcept |
|
overridevirtual |
Provides a consistent type name for the component.
Implements Component.
|
protected |
|
protected |
|
protected |