spawning objects
This commit is contained in:
parent
f717e1c109
commit
cce4bfb637
@ -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 */
|
||||
@ -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<class T, typename... Args>
|
||||
std::shared_ptr<T> spawnObject(Args&&... args);
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user