#include "classicmode/classicfactory.h"

#include "graphics/classicscenegraphicsmanager.h"
#include "graphics/classicgraphicsfactory.h"

#include "core/timeline.h"
#include "game/classicgame.h"
#include "editor/classiceditor.h"
#include "editor/selectionmanager.h"


std::unique_ptr<kku::Game> classic::getGame(const std::shared_ptr<kku::CoreFactory>& core_factory)
{
    // read offset from beatmap metadata
    const kku::microsec visibility_offset = 1648648;

    const auto factory = std::make_shared<ClassicGraphicsFactory>(core_factory);
    const auto timeline = std::make_shared<kku::Timeline<ClassicNote>>();
    const auto graphics_manager = std::make_shared<ClassicSceneGraphicsManager<ClassicNote>>(timeline, factory, visibility_offset);

    return std::make_unique<ClassicGame>(timeline, graphics_manager);
}

std::unique_ptr<kku::Editor> classic::getEditor(const std::shared_ptr<kku::CoreFactory>& core_factory)
{
    // read offset from beatmap metadata
    const kku::microsec visibility_offset = 1648648;

    const auto factory = std::make_shared<ClassicGraphicsFactory>(core_factory);
    const auto timeline = std::make_shared<kku::Timeline<ClassicNote>>();
    const auto graphics_manager = std::make_shared<ClassicSceneGraphicsManager<ClassicNote>>(timeline, factory, visibility_offset);

    return std::make_unique<ClassicEditor>(timeline, graphics_manager);
}
