entity destruction, etc.
This commit is contained in:
@@ -20,6 +20,7 @@ namespace Game::State {
|
||||
}
|
||||
|
||||
void sort(); // Sort entities by zIndex for correct rendering order
|
||||
void wipe();
|
||||
Object::Entity* getEntityByName(const std::string& name); // Get an entity by name, returns nullptr if no entity with the name exists
|
||||
std::vector<Object::Entity*> getEntitiesSnapshot(bool sortByZIndex = false); // Get a stable snapshot of entity pointers for iteration outside the lock
|
||||
|
||||
@@ -27,6 +28,7 @@ namespace Game::State {
|
||||
Object::Entity* getAtIndex(size_t at);
|
||||
// Add an entity to the gamestate.
|
||||
void addEntity(std::unique_ptr<Object::Entity> entity);
|
||||
bool removeEntity(const std::string& name);
|
||||
|
||||
private:
|
||||
mutable std::mutex mMutex; // Shared mutex for thread safety
|
||||
|
||||
Reference in New Issue
Block a user