World structure that contains Object
s, and exists within Map
.
More...
#include <layer.hpp>
|
Engine & | engine |
| Parent Engine
|
|
const ID< Layer > | m_id {ID<Layer>::Unique()} |
| Personal ID .
|
|
std::string | m_name |
| String anme; could be useful in debugging.
|
|
ID< Map > | m_parentMap |
| Parent Map .
|
|
std::vector< ID< Object > > | m_objects |
| Contained Object s.
|
|
bool | m_visible = true |
| true : will be rendered by Camera . false : won't be.
|
|
uint8_t | m_alpha = std::numeric_limits<uint8_t>::max() |
| Opacity used by Camera when rendering contained Object s.
|
|
RGBA | m_frgba = RGBAColors::transparent |
| Foreground color added by Camera after rendering contained Object s.
|
|
RGBA | m_brgba = RGBAColors::transparent |
| Background color added by Camera after rendering contained Object s.
|
|
|
virtual auto | OnTick () -> bool |
| Virtual function called once each tick.
|
|
World structure that contains Object
s, and exists within Map
.
Separates Object
s in collision (only Object
s from the same Layer
can collide), and orders Object
s in rendering (Object
s in the first Layer
added to a Map
will be covered by Object
s from the following Layer
, and so on).
◆ Layer() [1/2]
KTech::Layer::Layer |
( |
Engine & | engine, |
|
|
std::string | name = "" ) |
Construct a Layer
.
- Parameters
-
[in] | engine | Parent Engine . |
[in] | name | String name. |
◆ Layer() [2/2]
KTech::Layer::Layer |
( |
Engine & | engine, |
|
|
const ID< Map > & | parentMap, |
|
|
std::string | name = "" ) |
Construct a Layer
and immediately enter a Map
.
- Parameters
-
[in] | engine | Parent Engine . |
[in] | parentMap | Map to enter. |
[in] | name | String name. |
◆ ~Layer()
Destruct a Layer
.
Removes all contained Object
s, leaves parent Map
(if in one), and removes itself from Memory
.
◆ AddObject()
auto KTech::Layer::AddObject |
( |
const ID< Object > & | object | ) |
-> bool |
◆ EnterMap()
auto KTech::Layer::EnterMap |
( |
const ID< Map > & | map | ) |
-> bool |
Enter a Map
.
- Parameters
-
- Returns
true
if entered Map
. false
if given Map
doesn't exist in Memory
or already the parent Map
.
◆ LeaveMap()
auto KTech::Layer::LeaveMap |
( |
| ) |
-> bool |
◆ OnTick()
auto KTech::Layer::OnTick |
( |
| ) |
-> bool |
|
protectedvirtual |
◆ operator[]()
auto KTech::Layer::operator[] |
( |
size_t | index | ) |
-> ID<Object>& |
Retrieve Object
ID
at given index.
- Returns
- Reference to the
ID<Object>
at the given index.
◆ RemoveAllObjects()
auto KTech::Layer::RemoveAllObjects |
( |
| ) |
-> bool |
◆ RemoveObject()
auto KTech::Layer::RemoveObject |
( |
const ID< Object > & | object | ) |
-> bool |
Remove an Object
.
- Parameters
-
- Returns
true
if removed. false
if doesn't exist in Memory
, or isn't in Layer
.
The documentation for this class was generated from the following files: