2022-02-05 20:33:09 -05:00
|
|
|
#include "classicmode/classicfactory.h"
|
2021-12-28 13:04:50 -05:00
|
|
|
|
|
|
|
#include "graphics/classicscenegraphicsmanager.h"
|
2022-05-25 22:42:56 -04:00
|
|
|
#include "graphics/classictimelinegraphicsmanager.h"
|
2022-02-05 20:33:09 -05:00
|
|
|
#include "graphics/classicgraphicsfactory.h"
|
2021-12-28 13:04:50 -05:00
|
|
|
|
2022-02-05 20:33:09 -05:00
|
|
|
#include "core/timeline.h"
|
2021-12-28 13:04:50 -05:00
|
|
|
#include "game/classicgame.h"
|
2022-05-15 03:30:33 -04:00
|
|
|
#include "game/gamecontext.h"
|
2022-05-17 00:22:18 -04:00
|
|
|
#include "game/holdmanager.h"
|
2021-12-28 13:04:50 -05:00
|
|
|
#include "editor/classiceditor.h"
|
2022-05-22 00:17:15 -04:00
|
|
|
#include "editor/editorcontext.h"
|
2022-02-09 18:30:49 -05:00
|
|
|
#include "editor/selectionmanager.h"
|
2021-12-28 13:04:50 -05:00
|
|
|
|
2021-12-29 09:59:18 -05:00
|
|
|
|
2022-02-05 20:33:09 -05:00
|
|
|
std::unique_ptr<kku::Game> classic::getGame(const std::shared_ptr<kku::CoreFactory>& core_factory)
|
2021-12-28 13:04:50 -05:00
|
|
|
{
|
2021-12-29 09:59:18 -05:00
|
|
|
const kku::microsec visibility_offset = 1648648;
|
2021-12-28 13:04:50 -05:00
|
|
|
|
2022-02-05 20:33:09 -05:00
|
|
|
const auto factory = std::make_shared<ClassicGraphicsFactory>(core_factory);
|
2021-12-29 09:59:18 -05:00
|
|
|
const auto timeline = std::make_shared<kku::Timeline<ClassicNote>>();
|
2022-05-17 00:22:18 -04:00
|
|
|
const auto graphics_manager = std::make_shared<ClassicSceneGraphicsManager>(timeline, factory, visibility_offset);
|
2022-05-15 03:30:33 -04:00
|
|
|
const auto hold_manager = std::make_shared<HoldManager>();
|
2021-12-28 13:04:50 -05:00
|
|
|
|
2022-05-15 03:30:33 -04:00
|
|
|
const auto context = std::make_shared<GameContext>(hold_manager, graphics_manager);
|
|
|
|
|
|
|
|
return std::make_unique<ClassicGame>(timeline, context);
|
2021-12-28 13:04:50 -05:00
|
|
|
}
|
|
|
|
|
2022-02-05 20:33:09 -05:00
|
|
|
std::unique_ptr<kku::Editor> classic::getEditor(const std::shared_ptr<kku::CoreFactory>& core_factory)
|
2021-12-28 13:04:50 -05:00
|
|
|
{
|
2021-12-29 09:59:18 -05:00
|
|
|
const kku::microsec visibility_offset = 1648648;
|
2021-12-28 13:04:50 -05:00
|
|
|
|
2022-02-05 20:33:09 -05:00
|
|
|
const auto factory = std::make_shared<ClassicGraphicsFactory>(core_factory);
|
2022-03-15 13:11:17 -04:00
|
|
|
const auto timeline = std::make_shared<kku::Timeline<ClassicNote>>();
|
2022-05-22 00:17:15 -04:00
|
|
|
const auto selection_manager = std::make_shared<SelectionManager<ClassicNote>>();
|
|
|
|
std::vector<std::shared_ptr<ClassicGraphicsManager>> graphics_managers;
|
|
|
|
graphics_managers.emplace_back(std::make_shared<ClassicSceneGraphicsManager>(timeline, factory, visibility_offset));
|
2022-05-25 22:42:56 -04:00
|
|
|
graphics_managers.emplace_back(std::make_shared<ClassicTimelineGraphicsManager>(timeline, factory, visibility_offset * 2));
|
2022-05-22 00:17:15 -04:00
|
|
|
|
|
|
|
const auto context = std::make_shared<EditorContext>(selection_manager, std::move(graphics_managers));
|
2021-12-28 13:04:50 -05:00
|
|
|
|
2022-05-22 00:17:15 -04:00
|
|
|
return std::make_unique<ClassicEditor>(timeline, context);
|
2021-12-28 13:04:50 -05:00
|
|
|
}
|