forked from NaiJi/project-kyoku
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.
45 lines
1.7 KiB
C
45 lines
1.7 KiB
C
2 years ago
|
#pragma once
|
||
|
|
||
|
#include "classicmode/classicnote.h"
|
||
|
#include "graphics/classicgraphicsmanager.h"
|
||
|
#include "graphics/classicgraphicsfactory.h"
|
||
|
#include "core/timeline.h"
|
||
|
#include "core/spritecontainer.h"
|
||
|
|
||
|
#include "game/arrowelement.h"
|
||
|
|
||
|
#include "graphics/animations/classicflyinganimationscenario.h"
|
||
|
#include "graphics/animations/classicdyinganimationscenario.h"
|
||
|
|
||
|
class ClassicTimelineGraphicsManager : public ClassicGraphicsManager
|
||
|
{
|
||
|
public:
|
||
|
explicit ClassicTimelineGraphicsManager(const std::shared_ptr<kku::Timeline<ClassicNote>>& timeline,
|
||
|
const std::shared_ptr<ClassicGraphicsFactory>& factory,
|
||
|
const kku::microsec& visibility_offset);
|
||
|
|
||
|
virtual void input(kku::GameEvent&& input) override;
|
||
|
virtual void display() const override;
|
||
|
virtual void update(const kku::microsec& offset) override;
|
||
|
|
||
|
virtual void update(const kku::microsec& offset, ClassicArrowNote* note) override;
|
||
|
virtual void draw(const std::vector<ArrowElement>& elements) const override;
|
||
|
|
||
|
protected:
|
||
|
kku::SpriteContainer<Type, ClassicGraphicsFactory, ClassicNoteGraphics> _sprite_container;
|
||
|
const std::shared_ptr<const ClassicGraphicsFactory> _factory;
|
||
|
|
||
|
typedef typename std::set<ClassicNote*>::const_iterator Iterator;
|
||
|
|
||
|
Iterator _first;
|
||
|
Iterator _last;
|
||
|
|
||
|
const std::shared_ptr<kku::Timeline<ClassicNote>> _timeline;
|
||
|
|
||
|
inline bool nothingToDraw() const noexcept;
|
||
|
inline bool isVisiblyClose(const ClassicNote * const note, const kku::microsec& music_offset) const noexcept;
|
||
|
void fetchFirstNote(const kku::microsec& offset);
|
||
|
void fetchLastNote(const kku::microsec& offset);
|
||
|
void updateVisibleNotes(const kku::microsec& offset);
|
||
|
};
|