Move through course, sprite and input
Signed-off-by: Daniel Henry <iamdanhenry@gmail.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user