project-kyoku/modes/classicmode/sfml/classicfactorysfml.cpp

33 lines
1.3 KiB
C++
Raw Normal View History

#include "shared/classicmode/classicfactorysfml.h"
#include "sfml/spritefactorysfml.h"
#include "graphics/classicscenegraphicsmanager.h"
#include "core/timeline.h"
#include "game/classicgame.h"
#include "editor/classiceditor.h"
std::unique_ptr<Game> classic::initGame(const std::shared_ptr<sf::RenderTarget>& render_target)
{
// read offset from beatmap metadata
const microsec visibility_offset = 1648648;
const auto factory = std::make_shared<ClassicSpriteFactorySFML>(render_target);
const auto timeline = std::make_shared<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<Editor> classic::initEditor(const std::shared_ptr<sf::RenderTarget>& render_target)
{
// read offset from beatmap metadata
const microsec visibility_offset = 1648648;
const auto factory = std::make_shared<ClassicSpriteFactorySFML>(render_target);
const auto timeline = std::make_shared<Timeline<ClassicNote>>();
const auto graphics_manager = std::make_shared<ClassicSceneGraphicsManager>(timeline, factory, visibility_offset);
return std::make_unique<ClassicEditor>(timeline, graphics_manager);
}