project-kyoku/src/modes/classicmode/classicfactory.cpp

37 lines
1.5 KiB
C++
Raw Normal View History

2022-02-06 02:33:09 +01:00
#include "classicmode/classicfactory.h"
#include "graphics/classicscenegraphicsmanager.h"
2022-02-06 02:33:09 +01:00
#include "graphics/classicgraphicsfactory.h"
2022-02-06 02:33:09 +01:00
#include "core/timeline.h"
#include "game/classicgame.h"
#include "editor/classiceditor.h"
2022-02-10 00:30:49 +01:00
#include "editor/selectionmanager.h"
2021-12-29 15:59:18 +01:00
2022-02-06 02:33:09 +01:00
std::unique_ptr<kku::Game> classic::getGame(const std::shared_ptr<kku::CoreFactory>& core_factory)
{
// read offset from beatmap metadata
2021-12-29 15:59:18 +01:00
const kku::microsec visibility_offset = 1648648;
2022-02-06 02:33:09 +01:00
const auto factory = std::make_shared<ClassicGraphicsFactory>(core_factory);
2021-12-29 15:59:18 +01:00
const auto timeline = std::make_shared<kku::Timeline<ClassicNote>>();
2022-02-10 00:30:49 +01:00
const auto selection_manager = std::make_shared<SelectionManager>();
const auto graphics_manager = std::make_shared<ClassicSceneGraphicsManager>(timeline, factory, visibility_offset);
return std::make_unique<ClassicGame>(timeline, graphics_manager);
}
2022-02-06 02:33:09 +01:00
std::unique_ptr<kku::Editor> classic::getEditor(const std::shared_ptr<kku::CoreFactory>& core_factory)
{
// read offset from beatmap metadata
2021-12-29 15:59:18 +01:00
const kku::microsec visibility_offset = 1648648;
2022-02-06 02:33:09 +01:00
const auto factory = std::make_shared<ClassicGraphicsFactory>(core_factory);
2021-12-29 15:59:18 +01:00
const auto timeline = std::make_shared<kku::Timeline<ClassicNote>>();
2022-02-10 00:30:49 +01:00
const auto selection_manager = std::make_shared<SelectionManager>();
const auto graphics_manager = std::make_shared<ClassicSceneGraphicsManager>(timeline, factory, visibility_offset);
2022-02-10 00:30:49 +01:00
return std::make_unique<ClassicEditor>(timeline, graphics_manager, selection_manager);
}