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