Skip to content
Flecs v4.1
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
8namespace flecs {
9
10template <typename... Args>
11inline 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
17template <typename T>
18inline 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::entity prefab(const char *name=nullptr) const
Create a prefab that's associated with a type.
Definition impl.hpp:18
Entity.
Definition entity.hpp:30
entity()
Default constructor.
Definition entity.hpp:32
world_t * world_
Pointer to the underlying C world.
Definition world.hpp:1009