spawning objects

This commit is contained in:
DanielProl1xy
2024-02-19 11:43:53 +03:00
parent c6e3869176
commit f717e1c109
10 changed files with 40 additions and 42 deletions
+7 -3
View File
@@ -6,6 +6,8 @@
#include "../typedefs.h"
#include "../settings.h"
#include <list>
#include <vector>
#include <chrono>
class Content;
class World;
@@ -20,11 +22,13 @@ class PhysicsSolver;
class ChunksStorage;
class Level {
private:
int objCounter;
public:
std::unique_ptr<World> world;
const Content* const content;
std::list<Object*> objects;
Player* player;
std::list<std::shared_ptr<Object>> objects;
std::shared_ptr<Player> player;
Chunks* chunks;
ChunksStorage* chunksStorage;
std::unique_ptr<Inventories> inventories;
@@ -45,7 +49,7 @@ public:
World* getWorld();
template<class T, typename... Args>
T* spawnObjectOfClass(Args&&... args);
std::shared_ptr<T> spawnObject(Args&&... args);
};
#endif /* WORLD_LEVEL_H_ */