2021-12-29 15:59:18 +01:00
|
|
|
#include "classicfactorysfml.h"
|
|
|
|
#include "spritefactorysfml.h"
|
2021-12-28 19:04:50 +01:00
|
|
|
|
|
|
|
#include "graphics/classicscenegraphicsmanager.h"
|
|
|
|
#include "core/timeline.h"
|
|
|
|
|
|
|
|
#include "game/classicgame.h"
|
|
|
|
#include "editor/classiceditor.h"
|
|
|
|
|
2022-01-12 15:09:43 +01:00
|
|
|
ClassicFactorySFML::ClassicFactorySFML(sf::RenderTarget * const render_target) :
|
2021-12-29 15:59:18 +01:00
|
|
|
_render_target(render_target)
|
|
|
|
{}
|
|
|
|
|
|
|
|
std::unique_ptr<kku::Game> ClassicFactorySFML::getGame() const
|
2021-12-28 19:04:50 +01:00
|
|
|
{
|
|
|
|
// read offset from beatmap metadata
|
2021-12-29 15:59:18 +01:00
|
|
|
const kku::microsec visibility_offset = 1648648;
|
2021-12-28 19:04:50 +01:00
|
|
|
|
2021-12-29 15:59:18 +01:00
|
|
|
const auto factory = std::make_shared<ClassicSpriteFactorySFML>(_render_target);
|
|
|
|
const auto timeline = std::make_shared<kku::Timeline<ClassicNote>>();
|
2021-12-28 19:04:50 +01:00
|
|
|
const auto graphics_manager = std::make_shared<ClassicSceneGraphicsManager>(timeline, factory, visibility_offset);
|
|
|
|
|
|
|
|
return std::make_unique<ClassicGame>(timeline, graphics_manager);
|
|
|
|
}
|
|
|
|
|
2021-12-29 15:59:18 +01:00
|
|
|
std::unique_ptr<kku::Editor> ClassicFactorySFML::getEditor() const
|
2021-12-28 19:04:50 +01:00
|
|
|
{
|
|
|
|
// read offset from beatmap metadata
|
2021-12-29 15:59:18 +01:00
|
|
|
const kku::microsec visibility_offset = 1648648;
|
2021-12-28 19:04:50 +01:00
|
|
|
|
2021-12-29 15:59:18 +01:00
|
|
|
const auto factory = std::make_shared<ClassicSpriteFactorySFML>(_render_target);
|
|
|
|
const auto timeline = std::make_shared<kku::Timeline<ClassicNote>>();
|
2021-12-28 19:04:50 +01:00
|
|
|
const auto graphics_manager = std::make_shared<ClassicSceneGraphicsManager>(timeline, factory, visibility_offset);
|
|
|
|
|
|
|
|
return std::make_unique<ClassicEditor>(timeline, graphics_manager);
|
|
|
|
}
|