From cce4bfb63719cdce04844efab623ab63a72df43e Mon Sep 17 00:00:00 2001 From: DanielProl1xy Date: Mon, 19 Feb 2024 10:10:53 +0300 Subject: [PATCH] spawning objects --- src/interfaces/Object.h | 4 ++-- src/world/Level.h | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/interfaces/Object.h b/src/interfaces/Object.h index 5f9aae83..5ffe1cb6 100644 --- a/src/interfaces/Object.h +++ b/src/interfaces/Object.h @@ -17,9 +17,9 @@ public: ~Object() { destroyed(); } public: - virtual void spawned() { } + virtual void spawned() { } virtual void update(float delta) { } - virtual void destroyed() { } + virtual void destroyed() { } }; #endif /* OBJECT_H */ \ No newline at end of file diff --git a/src/world/Level.h b/src/world/Level.h index da7f4ce1..fbf9d283 100644 --- a/src/world/Level.h +++ b/src/world/Level.h @@ -48,6 +48,9 @@ public: World* getWorld(); + // Spawns object of class T and returns pointer to it. + // @param T class that derives the Object class + // @param args pass arguments needed for T class constructor template std::shared_ptr spawnObject(Args&&... args); };