Skip to content
Flecs
v4.1
Search
Ctrl K
include
flecs
addons
cpp
mixins
prefab
impl.hpp
Go to the documentation of this file.
1
/**
2
* @file addons/cpp/mixins/prefab/impl.hpp
3
* @brief Prefab implementation.
4
*/
5
6
#pragma once
7
8
namespace
flecs {
9
10
template
<
typename
... Args>
11
inline
flecs::entity
world::prefab
(Args &&... args)
const
{
12
flecs::entity
result =
flecs::entity
(
world_
, FLECS_FWD(args)...);
13
result.add(flecs::Prefab);
14
return
result;
15
}
16
17
template
<
typename
T>
18
inline
flecs::entity
world::prefab
(
const
char
*name)
const
{
19
flecs::entity
result = this->
entity<T>
(name);
20
result.add(flecs::Prefab);
21
return
result;
22
}
23
24
}
flecs::world::prefab
flecs::entity prefab(const char *name=nullptr) const
Create a prefab that's associated with a type.
Definition
impl.hpp:18
flecs::entity
Entity.
Definition
entity.hpp:30
flecs::entity::entity
entity()
Default constructor.
Definition
entity.hpp:32
flecs::world::world_
world_t * world_
Pointer to the underlying C world.
Definition
world.hpp:1009
Esc
↑
↓
to navigate
↵
to open
Esc
to close