forked from NaiJi/project-kyoku
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.3 KiB
C++
37 lines
1.3 KiB
C++
#include "classicfactorysfml.h"
|
|
#include "spritefactorysfml.h"
|
|
|
|
#include "graphics/classicscenegraphicsmanager.h"
|
|
#include "core/timeline.h"
|
|
|
|
#include "game/classicgame.h"
|
|
#include "editor/classiceditor.h"
|
|
|
|
ClassicFactorySFML::ClassicFactorySFML(sf::RenderTarget * const render_target) :
|
|
_render_target(render_target)
|
|
{}
|
|
|
|
std::unique_ptr<kku::Game> ClassicFactorySFML::getGame() const
|
|
{
|
|
// read offset from beatmap metadata
|
|
const kku::microsec visibility_offset = 1648648;
|
|
|
|
const auto factory = std::make_shared<ClassicSpriteFactorySFML>(_render_target);
|
|
const auto timeline = std::make_shared<kku::Timeline<ClassicNote>>();
|
|
const auto graphics_manager = std::make_shared<ClassicSceneGraphicsManager>(timeline, factory, visibility_offset);
|
|
|
|
return std::make_unique<ClassicGame>(timeline, graphics_manager);
|
|
}
|
|
|
|
std::unique_ptr<kku::Editor> ClassicFactorySFML::getEditor() const
|
|
{
|
|
// read offset from beatmap metadata
|
|
const kku::microsec visibility_offset = 1648648;
|
|
|
|
const auto factory = std::make_shared<ClassicSpriteFactorySFML>(_render_target);
|
|
const auto timeline = std::make_shared<kku::Timeline<ClassicNote>>();
|
|
const auto graphics_manager = std::make_shared<ClassicSceneGraphicsManager>(timeline, factory, visibility_offset);
|
|
|
|
return std::make_unique<ClassicEditor>(timeline, graphics_manager);
|
|
}
|