1
0
mirror of synced 2025-02-08 14:58:16 +01:00

Move GradedNote to Data

This commit is contained in:
Stepland 2020-05-02 18:04:52 +02:00
parent 16a689a43e
commit 8c69bed6e2
6 changed files with 13 additions and 12 deletions

View File

@ -11,6 +11,7 @@
- Combo
- compute
- display
- Shutter
## Results Screen

View File

@ -14,6 +14,8 @@ sources = [
'include/whereami/whereami++.cpp',
'src/Data/Chart.cpp',
'src/Data/Chart.hpp',
'src/Data/GradedNote.cpp',
'src/Data/GradedNote.hpp',
'src/Data/Note.hpp',
'src/Data/Preferences.hpp',
'src/Data/Preferences.cpp',
@ -66,8 +68,6 @@ sources = [
'src/Screens/MusicSelect/SongInfo.cpp',
'src/Screens/Gameplay/Gameplay.hpp',
'src/Screens/Gameplay/Gameplay.cpp',
'src/Screens/Gameplay/GradedNote.cpp',
'src/Screens/Gameplay/GradedNote.hpp',
'src/Screens/Gameplay/PreciseMusic.hpp',
'src/Screens/Gameplay/PreciseMusic.cpp',
'src/Screens/Gameplay/Silence.hpp',

View File

@ -1,6 +1,6 @@
#include "GradedNote.hpp"
namespace Gameplay {
namespace Data {
Resources::MarkerAnimation judgement_to_animation(const Judgement& j) {
switch (j) {
case Judgement::Perfect:

View File

@ -4,10 +4,10 @@
#include <SFML/System/Time.hpp>
#include "../../Data/Note.hpp"
#include "../../Resources/Marker.hpp"
#include "../Resources/Marker.hpp"
#include "Note.hpp"
namespace Gameplay {
namespace Data {
enum class Judgement {
Perfect,
Great,

View File

@ -21,7 +21,7 @@ namespace Gameplay {
marker(t_resources.shared.get_selected_marker())
{
for (auto&& note : chart.notes) {
notes.emplace_back(GradedNote{note});
notes.emplace_back(Data::GradedNote{note});
}
auto music_path = song_selection.song.full_audio_path();
if (music_path) {
@ -166,7 +166,7 @@ namespace Gameplay {
if (note.timed_judgment) {
continue;
}
notes[i].store(GradedNote{note, music_time-note.timing});
notes[i].store(Data::GradedNote{note, music_time-note.timing});
break;
}
}
@ -179,7 +179,7 @@ namespace Gameplay {
note_index = i;
break;
} else {
note.timed_judgment.emplace(sf::Time::Zero, Judgement::Miss);
note.timed_judgment.emplace(sf::Time::Zero, Data::Judgement::Miss);
notes[i].store(note);
}
}

View File

@ -7,6 +7,7 @@
#include <SFML/Graphics.hpp>
#include "../../Data/Chart.hpp"
#include "../../Data/GradedNote.hpp"
#include "../../Data/Note.hpp"
#include "../../Data/Song.hpp"
#include "../../Data/Score.hpp"
@ -15,7 +16,6 @@
#include "../../Input/Events.hpp"
#include "../../Toolkit/Debuggable.hpp"
#include "AbstractMusic.hpp"
#include "GradedNote.hpp"
#include "Resources.hpp"
namespace Gameplay {
@ -35,9 +35,9 @@ namespace Gameplay {
const Resources::Marker& marker;
std::unique_ptr<AbstractMusic> music;
std::deque<std::atomic<GradedNote>> notes;
std::deque<std::atomic<Data::GradedNote>> notes;
std::atomic<std::size_t> note_index;
// moves note_cursor forward to the first note that has to be conscidered for judging
// moves note_index forward to the first note that has to be conscidered for judging
// marks every note between the old and the new position as missed
void update_note_index(const sf::Time& music_time);