Capycore Engine  0.1.0
A simple and lightweight game engine written in C++ based on the Unity API architecture.
Loading...
Searching...
No Matches
renderable.h
Go to the documentation of this file.
1#pragma once
2
5
6#include <memory>
7
16class Renderable : public Component { // NOLINT
17 protected:
18 std::unique_ptr<IRenderingStrategy> render_strategy_;
20 bool draw{true};
21
22 public:
23 explicit Renderable();
24 explicit Renderable(int layer);
25 ~Renderable() override = default;
26
28 [[nodiscard]] int order_in_layer() const;
29
31 [[nodiscard]] virtual IRenderingStrategy& render_strategy() const;
32
33 std::string type_name() const override;
34
37 [[nodiscard]] bool should_draw() const noexcept;
38};
Base class for all components that can be attached to GameObjects.
Definition component.h:24
Interface for rendering strategies used by renderable components.
Definition irendering_strategy.h:13
Base class for renderable components in the engine.
Definition renderable.h:16
std::string type_name() const override
Provides a consistent type name for the component.
Renderable & order_in_layer(int layer)
std::unique_ptr< IRenderingStrategy > render_strategy_
Definition renderable.h:18
~Renderable() override=default
void set_render_strategy(Component &component)
Renderable(int layer)
bool should_draw() const noexcept
virtual IRenderingStrategy & render_strategy() const
Renderable & enable_draw() noexcept
int order_in_layer() const
bool draw
Definition renderable.h:20
Renderable & disable_draw() noexcept
int ordering_layer_
Definition renderable.h:19