R-Type
Distributed multiplayer game engine in C++
Loading...
Searching...
No Matches
EntityBuilder.cpp
Go to the documentation of this file.
1/*
2** EPITECH PROJECT, 2025
3** rtype
4** File description:
5** EntityBuilder implementation
6*/
7
8#include "EntityBuilder.hpp"
9
10namespace ecs::wrapper {
11
12 EntityBuilder::EntityBuilder(ECSWorld *world) : _world(world), _entity(world->createEntity()) {}
13
14 EntityBuilder &EntityBuilder::configure(std::function<void(Entity &)> configurator) {
15 configurator(_entity);
16 return *this;
17 }
18
20 return _entity;
21 }
22
23 EntityBuilder::operator Entity() {
24 return build();
25 }
26
27} // namespace ecs::wrapper
High-level ECS manager providing clean server-side API.
Definition ECSWorld.hpp:122
Builder pattern for creating entities with multiple components.
EntityBuilder & configure(std::function< void(Entity &)> configurator)
Apply a configuration function to the entity.
EntityBuilder(ECSWorld *world)
Construct an EntityBuilder.
Entity build()
Finalize and return the built entity.
High-level entity wrapper providing fluent interface.
Definition ECSWorld.hpp:33