Finished lecture 82

Signed-off-by: Daniel Henry <iamdanhenry@gmail.com>
This commit is contained in:
2025-09-02 09:32:30 -05:00
parent 7d2cd86fd4
commit c545d800d2
7 changed files with 149 additions and 92 deletions

View File

@@ -1,21 +1,33 @@
#pragma once
#include "framework/Core.h"
class Application;
class Actor;
namespace ly {
class Application;
class World {
public:
World(Application *owningApp);
class World {
public:
World(Application *owningApp);
void BeginPlayInternal();
void TickInternal(float deltaTime);
void BeginPlayInternal();
void TickInternal(float deltaTime);
virtual ~World();
virtual ~World();
private:
void BeginPlay();
void Tick(float deltaTime);
Application* mOwningApp;
bool mBeganPlay;
};
}
template <typename ActorType>
weak<ActorType> SpawnActor() {
shared<ActorType> newActor{new ActorType{this}};
mPendingActors.push_back(newActor);
return newActor;
}
private:
void BeginPlay();
void Tick(float deltaTime);
Application *mOwningApp;
bool mBeganPlay;
List<shared<Actor>> mActors;
List<shared<Actor>> mPendingActors;
};
} // namespace ly