#pragma once

#include <memory>

#include "core/editor.h"
#include "core/timeline.h"
#include "selectionmanager.h"

#include "classicmode/classicnote.h"
#include "classicmode/classicactions.h"

class EditorContext;

class ClassicEditor : public kku::Editor
{
public:
    explicit ClassicEditor(const std::shared_ptr<kku::Timeline<ClassicNote>>& timeline,
                           const std::shared_ptr<EditorContext>& context);

    virtual void input(kku::GameEvent&& input) override;
    virtual void update(kku::UpdateData&& updatedata) override;
    virtual void display() const override;
    virtual void recalculate(const kku::microsec& timestamp) override;

    void selectNoteType(Type type) noexcept;

private:
    inline kku::microsec adjustOffset(kku::microsec offset) const noexcept;

    const std::shared_ptr<kku::Timeline<ClassicNote>> _timeline;
    const std::shared_ptr<EditorContext> _context;


    Type _selected_type;
    kku::microsec _current_time;
    kku::microsec _scroll_step;
    int _note_id;
};
