|
Botcraft 26.3
|
#include <EntityManager.hpp>
Public Member Functions | |
| EntityManager (const std::shared_ptr< NetworkManager > &network_manager) | |
| std::shared_ptr< LocalPlayer > | GetLocalPlayer () |
| std::shared_ptr< Entity > | GetEntity (const int id) const |
| void | AddEntity (const std::shared_ptr< Entity > &entity) |
| Utilities::ScopeLockedWrapper< const std::unordered_map< int, std::shared_ptr< Entity > >, std::shared_mutex, std::shared_lock > | GetEntities () const |
| Get a read-only locked version of all the loaded entities (including local player) | |
Private Attributes | |
| std::unordered_map< int, std::shared_ptr< Entity > > | entities |
| std::shared_ptr< LocalPlayer > | local_player |
| std::shared_mutex | entity_manager_mutex |
| std::shared_ptr< NetworkManager > | network_manager |
Definition at line 17 of file EntityManager.hpp.
| Botcraft::EntityManager::EntityManager | ( | const std::shared_ptr< NetworkManager > & | network_manager | ) |
Definition at line 19 of file EntityManager.cpp.
References local_player.
| void Botcraft::EntityManager::AddEntity | ( | const std::shared_ptr< Entity > & | entity | ) |
Definition at line 37 of file EntityManager.cpp.
References entities, and entity_manager_mutex.
| Utilities::ScopeLockedWrapper< const std::unordered_map< int, std::shared_ptr< Entity > >, std::shared_mutex, std::shared_lock > Botcraft::EntityManager::GetEntities | ( | ) | const |
Get a read-only locked version of all the loaded entities (including local player)
Definition at line 48 of file EntityManager.cpp.
References entities, and entity_manager_mutex.
| std::shared_ptr< Entity > Botcraft::EntityManager::GetEntity | ( | const int | id | ) | const |
| std::shared_ptr< LocalPlayer > Botcraft::EntityManager::GetLocalPlayer | ( | ) |
Definition at line 24 of file EntityManager.cpp.
References entity_manager_mutex, and local_player.
Referenced by Handle(), Handle(), Handle(), Handle(), Handle(), and Handle().
|
overrideprotectedvirtual |
Definition at line 197 of file EntityManager.cpp.
References Botcraft::Entity::CreateEntity(), entities, and entity_manager_mutex.
|
overrideprotectedvirtual |
Definition at line 529 of file EntityManager.cpp.
References GetEntity(), GetLocalPlayer(), ProtocolCraft::Linear, and ProtocolCraft::Stepped.
|
overrideprotectedvirtual |
Definition at line 223 of file EntityManager.cpp.
References GetLocalPlayer(), and LOG_WARNING.
|
overrideprotectedvirtual |
Definition at line 389 of file EntityManager.cpp.
References GetLocalPlayer().
|
overrideprotectedvirtual |
Definition at line 54 of file EntityManager.cpp.
References entities, entity_manager_mutex, and local_player.
|
overrideprotectedvirtual |
Definition at line 81 of file EntityManager.cpp.
References GetEntity(), ProtocolCraft::ClientboundMoveEntityPacketPos::GetOnGround(), Botcraft::Vector3< T >::x, Botcraft::Vector3< T >::y, and Botcraft::Vector3< T >::z.
|
overrideprotectedvirtual |
Definition at line 132 of file EntityManager.cpp.
References GetEntity(), ProtocolCraft::ClientboundMoveEntityPacketPosRot::GetOnGround(), Botcraft::Vector3< T >::x, Botcraft::Vector3< T >::y, and Botcraft::Vector3< T >::z.
|
overrideprotectedvirtual |
Definition at line 185 of file EntityManager.cpp.
References GetEntity().
|
overrideprotectedvirtual |
Definition at line 568 of file EntityManager.cpp.
References GetEntity().
|
overrideprotectedvirtual |
Definition at line 354 of file EntityManager.cpp.
References GetLocalPlayer().
|
overrideprotectedvirtual |
Definition at line 369 of file EntityManager.cpp.
References entities, and entity_manager_mutex.
|
overrideprotectedvirtual |
Definition at line 514 of file EntityManager.cpp.
References GetEntity(), and LOG_WARNING.
|
overrideprotectedvirtual |
Definition at line 379 of file EntityManager.cpp.
References GetLocalPlayer().
|
overrideprotectedvirtual |
Definition at line 401 of file EntityManager.cpp.
References GetEntity(), and LOG_WARNING.
|
overrideprotectedvirtual |
Definition at line 415 of file EntityManager.cpp.
References GetEntity(), and LOG_WARNING.
|
overrideprotectedvirtual |
Definition at line 434 of file EntityManager.cpp.
References GetEntity(), and LOG_WARNING.
|
overrideprotectedvirtual |
Definition at line 319 of file EntityManager.cpp.
References GetLocalPlayer().
|
overrideprotectedvirtual |
Definition at line 327 of file EntityManager.cpp.
References GetEntity().
|
overrideprotectedvirtual |
Definition at line 455 of file EntityManager.cpp.
References GetEntity(), LOG_WARNING, and Botcraft::EntityAttribute::SetModifier().
|
overrideprotectedvirtual |
Definition at line 496 of file EntityManager.cpp.
References GetEntity(), and LOG_WARNING.
|
private |
Definition at line 78 of file EntityManager.hpp.
Referenced by AddEntity(), GetEntities(), GetEntity(), Handle(), Handle(), and Handle().
|
mutableprivate |
Definition at line 82 of file EntityManager.hpp.
Referenced by AddEntity(), GetEntities(), GetEntity(), GetLocalPlayer(), Handle(), Handle(), and Handle().
|
private |
Definition at line 80 of file EntityManager.hpp.
Referenced by EntityManager(), GetLocalPlayer(), and Handle().
|
private |
Definition at line 84 of file EntityManager.hpp.