ECSTASY
All in the name
Loading...
Searching...
No Matches
DeletionStack.hpp
Go to the documentation of this file.
1
11
12#ifndef ECSTASY_REGISTRY_DELETIONSTACK_HPP_
13#define ECSTASY_REGISTRY_DELETIONSTACK_HPP_
14
15#include <vector>
16
18
19namespace ecstasy
20{
21 class Registry;
22
31 public:
40 DeletionStack(Registry &registry);
41
50 DeletionStack(const DeletionStack &other) = delete;
51
60
69 void push(Entity entity);
70
79 [[nodiscard]] size_t size() const noexcept;
80
81 private:
85 std::vector<Entity> _killed;
86 };
87} // namespace ecstasy
88
89#endif /* !ECSTASY_REGISTRY_DELETIONSTACK_HPP_ */
Encapsulate an index to an entity.
Helper to manage entity deletion safely within an iteration.
~DeletionStack()
Destroy the Deletion Stack, calling Registry::eraseEntities() with all the entity marked for deletion...
Registry & _registry
Registry attached to this stack.
size_t size() const noexcept
Return the number of entities marked for deletion.
DeletionStack(const DeletionStack &other)=delete
Deleted copy constructor.
void push(Entity entity)
Mark an entity for deletion upon destruction of this instance.
std::vector< Entity > _killed
Entities marked for deletion.
Encapsulate an index to an entity.
Definition Entity.hpp:35
Base of an ECS architecture.
Definition Registry.hpp:82
Namespace containing all symbols specific to ecstasy.
Definition ecstasy.hpp:30