project-kyoku/src/modes/classicmode/graphics/classicscenegraphicsmanager.h

38 lines
1.3 KiB
C
Raw Normal View History

2021-12-29 15:59:18 +01:00
#pragma once
#include "game/classicnote.h"
#include "graphics/classicgraphicsmanager.h"
#include "core/timeline.h"
class ClassicSprite;
class ClassicSceneGraphicsManager : public ClassicGraphicsManager
{
public:
explicit ClassicSceneGraphicsManager(const std::shared_ptr<kku::Timeline<ClassicNote>>& timeline,
const std::shared_ptr<ClassicSpriteFactory>& factory,
const kku::microsec& visibility_offset);
virtual void display() const override;
virtual void update(const kku::microsec& offset) override;
virtual void display(const std::vector<ArrowElement>& elements) const override;
virtual void setGraphics(std::vector<ArrowElement>& elements, kku::TimeRange&& range) override;
protected:
using Iterator = kku::Timeline<ClassicNote>::Iterator;
Iterator _first;
Iterator _last;
const std::shared_ptr<kku::Timeline<ClassicNote>> _timeline;
inline bool nothingToDraw() const noexcept;
inline bool isVisiblyClose(const Iterator& iterator, const kku::microsec& music_offset) const noexcept;
//inline sf::VertexArray makeLine(const kku::Point& c1, const kku::Point& c2) const;
void fetchFirstNote(const kku::microsec& offset);
void fetchLastNote(const kku::microsec& offset);
void updateVisibleNotes(const kku::microsec& offset);
};