Move through course, sprite and input

Signed-off-by: Daniel Henry <iamdanhenry@gmail.com>
This commit is contained in:
2025-09-05 11:00:14 -05:00
parent c545d800d2
commit b64f931010
342 changed files with 2258 additions and 33 deletions

View File

@@ -1,26 +1,25 @@
#pragma once
#include "framework/Core.h"
class Application;
class Actor;
#include "framework/Actor.h"
namespace ly {
class World {
class Application;
class World {
public:
World(Application *owningApp);
void BeginPlayInternal();
void TickInternal(float deltaTime);
void Render(sf::RenderWindow& window);
virtual ~World();
template <typename ActorType>
weak<ActorType> SpawnActor() {
shared<ActorType> newActor{new ActorType{this}};
mPendingActors.push_back(newActor);
return newActor;
}
weak<ActorType> SpawnActor();
private:
void BeginPlay();
@@ -30,4 +29,14 @@ private:
List<shared<Actor>> mActors;
List<shared<Actor>> mPendingActors;
};
template<typename ActorType>
weak<ActorType> World::SpawnActor()
{
shared<ActorType> newActor{ new ActorType(this)};
mPendingActors.push_back(newActor);
return newActor;
}
} // namespace ly