#pragma once #include "framework/Core.h" #include "framework/Actor.h" namespace ly { class Application; class World { public: World(Application *owningApp); void BeginPlayInternal(); void TickInternal(float deltaTime); void Render(sf::RenderWindow& window); virtual ~World(); template weak SpawnActor(); private: void BeginPlay(); void Tick(float deltaTime); Application *mOwningApp; bool mBeganPlay; List> mActors; List> mPendingActors; }; template weak World::SpawnActor() { shared newActor{ new ActorType(this)}; mPendingActors.push_back(newActor); return newActor; } } // namespace ly