#include "config.h"
#include "framework/AssetManager.h"
#include "framework/World.h"
#include "gameFramework/GameApplication.h"
#include "player/PlayerSpaceship.h"

ly::Application* GetApplication() {
	return new ly::GameApplication{};
}

namespace ly {
	GameApplication::GameApplication()
		: Application{600, 980, "LightYears", sf::Style::Titlebar | sf::Style::Close }
	{
		AssetManager::Get().SetAssetRootDirectory(GetResourceDir());
		weak<World> newWorld = LoadWorld<World>();

		testPlayerSpaceship = newWorld.lock()->SpawnActor<PlayerSpaceship>();
		testPlayerSpaceship.lock()->SetActorLocation(sf::Vector2f(300, 490));
		testPlayerSpaceship.lock()->SetActorRotation(0);
	}

	void GameApplication::Tick(float deltaTime) {

	}
}