From 206ad5c84a6630bd6d1d86a5744db075669af688 Mon Sep 17 00:00:00 2001 From: NaiJi Date: Wed, 14 Jul 2021 19:24:47 +0400 Subject: [PATCH] Start implementing multitouch --- src/classicgame/classicnote.cpp | 4 +++- src/classicgame/classicnote.h | 23 ++++++++++++++++------- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/src/classicgame/classicnote.cpp b/src/classicgame/classicnote.cpp index efb3beb..6305bb5 100644 --- a/src/classicgame/classicnote.cpp +++ b/src/classicgame/classicnote.cpp @@ -35,7 +35,9 @@ void ClassicNote::putToGame(const microsec &music_offset) bool ClassicNote::isInGame() const { - return _state == State::FLYING || _state == State::ACTIVE || _state == State::DYING; + return _state == State::FLYING + || _state == State::ACTIVE + || _state == State::DYING; } bool ClassicNote::isExpired() const diff --git a/src/classicgame/classicnote.h b/src/classicgame/classicnote.h index d87d0df..f1992e6 100644 --- a/src/classicgame/classicnote.h +++ b/src/classicgame/classicnote.h @@ -52,15 +52,24 @@ public: const Coordinates& getCoordinates() const noexcept; private: - const Coordinates _coordinates; - const PrecisionEvaluator _evaluator; - const std::array _keys; - const std::unique_ptr& _graphics_manager; - std::shared_ptr _sprite; + struct NoteElement + { + std::shared_ptr _sprite; + std::array, 5> _animations; - const Type _type; + const std::array _keys; + const Coordinates _coordinates; + const Type _type; + + bool pressed = false; + sf::Keyboard::Key pressed_as; + }; + + std::vector _elements; + + const PrecisionEvaluator _evaluator; + const std::unique_ptr& _graphics_manager; State _state; - std::array, 5> _animations; };