|
R-Type
Distributed multiplayer game engine in C++
|
High-level entity wrapper providing fluent interface. More...
#include <ECSWorld.hpp>

Public Member Functions | |
| Entity (Address address, Registry *registry) | |
| Construct an Entity wrapper. | |
| Address | getAddress () const |
| Get the entity's address. | |
| template<typename T > | |
| Entity & | with (const T &component) |
| Add/set a component to this entity. | |
| template<typename T > | |
| T & | get () |
| Get a component from this entity. | |
| template<typename T > | |
| const T & | get () const |
| Get a component from this entity (const version). | |
| template<typename T > | |
| bool | has () const |
| Check if this entity has a specific component. | |
| template<typename T > | |
| Entity & | remove () |
| Remove a component from this entity. | |
| bool | isValid () const |
| Check if this entity is valid. | |
| operator Address () const | |
| Implicit conversion to Address for compatibility. | |
Private Attributes | |
| Address | _address |
| Registry * | _registry |
High-level entity wrapper providing fluent interface.
Provides a clean, chainable API for entity operations. Acts as a handle to an entity in the registry.
Definition at line 33 of file ECSWorld.hpp.
Construct an Entity wrapper.
| address | The entity's address in the registry |
| registry | Pointer to the ECS registry |
Definition at line 37 of file ECSWorld.cpp.
| T & ecs::wrapper::Entity::get | ( | ) |
Get a component from this entity.
| T | Component type |
| std::runtime_error | if component doesn't exist |
Referenced by server::GameLogic::_applyPlayerInput(), server::GameLogic::_checkGameOverCondition(), Server::_serializeEntity(), scripting::bindings::ComponentBindingHelper::add(), scripting::bindings::bindServerGame(), scripting::bindings::ComponentBindingHelper::registerComponent(), and server::GameStateSerializer::serializeEntity().
| const T & ecs::wrapper::Entity::get | ( | ) | const |
Get a component from this entity (const version).
| T | Component type |
| std::runtime_error | if component doesn't exist |
| Address ecs::wrapper::Entity::getAddress | ( | ) | const |
Get the entity's address.
Definition at line 39 of file ECSWorld.cpp.
References _address.
Referenced by Server::_serializeEntity(), scripting::bindings::bindEntity(), scripting::bindings::bindServerGame(), ecs::wrapper::ECSWorld::destroyEntity(), and server::GameLogic::spawnPlayer().
| bool ecs::wrapper::Entity::has | ( | ) | const |
Check if this entity has a specific component.
| T | Component type |
Referenced by server::GameLogic::_applyPlayerInput(), server::GameLogic::_checkGameOverCondition(), Server::_serializeEntity(), scripting::bindings::ComponentBindingHelper::add(), scripting::bindings::bindServerGame(), scripting::bindings::ComponentBindingHelper::registerComponent(), and server::GameStateSerializer::serializeEntity().
| bool ecs::wrapper::Entity::isValid | ( | ) | const |
Check if this entity is valid.
Definition at line 43 of file ECSWorld.cpp.
References _address, _registry, and ecs::Registry::getSignature().
Referenced by scripting::bindings::bindEntity(), scripting::bindings::bindServerGame(), scripting::bindings::bindWorld(), ecs::wrapper::ECSWorld::destroyEntity(), and scripting::LuaSystemAdapter::update().

| ecs::wrapper::Entity::operator Address | ( | ) | const |
Implicit conversion to Address for compatibility.
Definition at line 57 of file ECSWorld.cpp.
| Entity & ecs::wrapper::Entity::remove | ( | ) |
Remove a component from this entity.
| T | Component type |
Referenced by scripting::bindings::ComponentBindingHelper::add(), and scripting::bindings::ComponentBindingHelper::registerComponent().
| Entity & ecs::wrapper::Entity::with | ( | const T & | component | ) |
Add/set a component to this entity.
| T | Component type |
| component | The component data |
Referenced by scripting::bindings::bindServerGame(), and server::GameLogic::spawnPlayer().
|
private |
Definition at line 35 of file ECSWorld.hpp.
Referenced by getAddress(), and isValid().
|
private |
Definition at line 36 of file ECSWorld.hpp.
Referenced by isValid().