diff --git a/core/shared/core/note.h b/core/shared/core/note.h index 6bf3e88..53e22d6 100644 --- a/core/shared/core/note.h +++ b/core/shared/core/note.h @@ -11,7 +11,6 @@ public: virtual bool isActive() const = 0; virtual void update(const microsec& music_offset) = 0; - virtual void input(PlayerInput&& inputdata) = 0; virtual void draw() const = 0; virtual void putToGame(const microsec& offset) = 0; diff --git a/modes/classicmode/CMakeLists.txt b/modes/classicmode/CMakeLists.txt index 0f9e700..bf052ac 100644 --- a/modes/classicmode/CMakeLists.txt +++ b/modes/classicmode/CMakeLists.txt @@ -10,7 +10,6 @@ file(GLOB_RECURSE SOURCES "editor/*.h" "editor/*.cpp" "graphics/*.h" "graphics/* add_library(classicmode STATIC ${SOURCES} ${HEADERS}) target_include_directories(classicmode PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include) -target_include_directories(classicmode PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/game) target_include_directories(classicmode PRIVATE ${CMAKE_SOURCE_DIR}/tools/shared) target_include_directories(classicmode PRIVATE ${CMAKE_SOURCE_DIR}/core/shared) target_link_libraries(classicmode tools core) diff --git a/modes/classicmode/editor/classiceditor.h b/modes/classicmode/editor/classiceditor.h index 8005c71..e7f96df 100644 --- a/modes/classicmode/editor/classiceditor.h +++ b/modes/classicmode/editor/classiceditor.h @@ -4,7 +4,6 @@ #include "core/editor.h" #include "tools/music.h" #include "core/timeline.h" -#include "game/classicnote.h" class ClassicGraphicsManager; diff --git a/modes/classicmode/editor/initializers/mockarrownoteinitializer.h b/modes/classicmode/editor/initializers/mockarrownoteinitializer.h new file mode 100644 index 0000000..f6a3317 --- /dev/null +++ b/modes/classicmode/editor/initializers/mockarrownoteinitializer.h @@ -0,0 +1,10 @@ +#pragma once + +#include "classicmode/noteinitializer.h" +#include "classicmode/elementinitializer.h" + +struct MockArrowNoteInitializer +{ + NoteInitializer initializer; + std::vector elements; +}; diff --git a/modes/classicmode/editor/mockclassicnote.cpp b/modes/classicmode/editor/mockclassicnote.cpp new file mode 100644 index 0000000..42d0b22 --- /dev/null +++ b/modes/classicmode/editor/mockclassicnote.cpp @@ -0,0 +1,7 @@ +#include "mockclassicnote.h" + +MockClassicNote::MockClassicNote(MockArrowNoteInitializer&& init) : + Note(init.initializer) +{ + +} diff --git a/modes/classicmode/editor/mockclassicnote.h b/modes/classicmode/editor/mockclassicnote.h new file mode 100644 index 0000000..b610952 --- /dev/null +++ b/modes/classicmode/editor/mockclassicnote.h @@ -0,0 +1,29 @@ +#pragma once + +#include "core/note.h" +#include "initializers/mockarrownoteinitializer.h" + +class MockClassicNote : public Note +{ +public: + + enum State + { + NONE, + + FLYING, + DYING, + DEAD + }; + + explicit MockClassicNote(MockArrowNoteInitializer&& init); + virtual ~MockClassicNote() = default; + + virtual bool isActive() const override final; + virtual bool isInGame() const override final; + virtual bool shouldRemove() const override final; + + virtual void putToGame(const microsec &music_offset) override = 0; + virtual void update(const microsec &music_offset) override = 0; + virtual void draw() const override = 0; +}; diff --git a/modes/classicmode/game/classicnote.h b/modes/classicmode/game/classicnote.h index eb20c19..dac3d80 100644 --- a/modes/classicmode/game/classicnote.h +++ b/modes/classicmode/game/classicnote.h @@ -3,7 +3,7 @@ #include "context.h" #include "core/note.h" #include "core/precisionevaluator.h" -#include "initializers/noteinitializer.h" +#include "classicmode/noteinitializer.h" class ClassicSprite; class ClassicAnimationScenario; @@ -38,9 +38,10 @@ public: virtual void putToGame(const microsec &music_offset) override = 0; virtual void update(const microsec &music_offset) override = 0; - virtual void input(PlayerInput&& inputdata) override = 0; virtual void draw() const override = 0; + virtual void input(PlayerInput&& inputdata) = 0; + protected: const PrecisionEvaluator _evaluator; diff --git a/modes/classicmode/game/initializers/arrowelementinitializer.h b/modes/classicmode/game/initializers/arrowelementinitializer.h index 8c82ad4..f8d2f84 100644 --- a/modes/classicmode/game/initializers/arrowelementinitializer.h +++ b/modes/classicmode/game/initializers/arrowelementinitializer.h @@ -1,10 +1,12 @@ #pragma once -#include "elementinitializer.h" +#include "classicmode/elementinitializer.h" #include "classicmode/classicactions.h" struct ArrowElementInitializer { ElementInitializer element; + Type type = Type::NONE; + std::array keys; }; diff --git a/modes/classicmode/game/initializers/arrownoteinitializer.h b/modes/classicmode/game/initializers/arrownoteinitializer.h index 258153f..e87cb1d 100644 --- a/modes/classicmode/game/initializers/arrownoteinitializer.h +++ b/modes/classicmode/game/initializers/arrownoteinitializer.h @@ -1,6 +1,6 @@ #pragma once -#include "noteinitializer.h" +#include "classicmode/noteinitializer.h" #include "arrowelementinitializer.h" struct ArrowNoteInitializer diff --git a/modes/classicmode/game/initializers/elementinitializer.h b/modes/classicmode/include/classicmode/elementinitializer.h similarity index 71% rename from modes/classicmode/game/initializers/elementinitializer.h rename to modes/classicmode/include/classicmode/elementinitializer.h index da4daaf..543b4e5 100644 --- a/modes/classicmode/game/initializers/elementinitializer.h +++ b/modes/classicmode/include/classicmode/elementinitializer.h @@ -4,11 +4,9 @@ #include "tools/mathutils.h" #include -#include struct ElementInitializer { Coordinates coordinates; std::vector falling_curve_interpolation; - std::array keys; // needs initialization }; diff --git a/modes/classicmode/game/initializers/noteinitializer.h b/modes/classicmode/include/classicmode/noteinitializer.h similarity index 100% rename from modes/classicmode/game/initializers/noteinitializer.h rename to modes/classicmode/include/classicmode/noteinitializer.h