You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.5 KiB
C++

#pragma once
#include <set>
#include "core/inputtype.h"
#include "core/bpmsection.h"
class Editor
{
public:
virtual ~Editor() = default;
virtual void input(PlayerInput&& inputdata) = 0;
virtual void update(const sf::Time& dt) = 0;
virtual void draw() const = 0;
inline void setBPMSections(const std::set<BPMSection, BPMSectionCompt>& sections) noexcept
{
_bpm_sections = sections;
}
inline void setBPMSections(std::set<BPMSection, BPMSectionCompt>&& sections) noexcept
{
_bpm_sections = std::move(sections);
}
inline void insertBPMSection(const BPMSection& section)
{
_bpm_sections.insert(section);
}
inline void insertBPMSection(BPMSection&& section)
{
_bpm_sections.insert(std::move(section));
}
/*void removeBPMSectionAt(const microsec& offset)
{
const auto section_it = std::find_if(_bpm_sections.rbegin(), _bpm_sections.rend(),
[offset](const auto& section)
{
return section.start_offset < offset;
});
if (section_it != _bpm_sections.rend())
_bpm_sections.erase((section_it + 1).base());
}*/
inline void clearBPMSections() noexcept
{
_bpm_sections.clear();
}
protected:
std::set<BPMSection, BPMSectionCompt> _bpm_sections;
};