Add initializers for Mock notes in Editor
This commit is contained in:
parent
b3bec61542
commit
0b1acd7697
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
#include "core/editor.h"
|
||||
#include "tools/music.h"
|
||||
#include "core/timeline.h"
|
||||
#include "game/classicnote.h"
|
||||
|
||||
class ClassicGraphicsManager;
|
||||
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
#pragma once
|
||||
|
||||
#include "classicmode/noteinitializer.h"
|
||||
#include "classicmode/elementinitializer.h"
|
||||
|
||||
struct MockArrowNoteInitializer
|
||||
{
|
||||
NoteInitializer initializer;
|
||||
std::vector<ElementInitializer> elements;
|
||||
};
|
|
@ -0,0 +1,7 @@
|
|||
#include "mockclassicnote.h"
|
||||
|
||||
MockClassicNote::MockClassicNote(MockArrowNoteInitializer&& init) :
|
||||
Note(init.initializer)
|
||||
{
|
||||
|
||||
}
|
|
@ -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;
|
||||
};
|
|
@ -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<Grade> _evaluator;
|
||||
|
||||
|
|
|
@ -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<sf::Keyboard::Key, 2> keys;
|
||||
};
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include "noteinitializer.h"
|
||||
#include "classicmode/noteinitializer.h"
|
||||
#include "arrowelementinitializer.h"
|
||||
|
||||
struct ArrowNoteInitializer
|
||||
|
|
|
@ -4,11 +4,9 @@
|
|||
#include "tools/mathutils.h"
|
||||
|
||||
#include <vector>
|
||||
#include <array>
|
||||
|
||||
struct ElementInitializer
|
||||
{
|
||||
Coordinates coordinates;
|
||||
std::vector<Coordinates> falling_curve_interpolation;
|
||||
std::array<sf::Keyboard::Key, 2> keys; // needs initialization
|
||||
};
|
Loading…
Reference in New Issue