Skip to content

Commit

Permalink
my bad chat 3
Browse files Browse the repository at this point in the history
  • Loading branch information
3drosalia committed Oct 7, 2024
1 parent 6ac45f7 commit dbe47f8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
1 change: 1 addition & 0 deletions Encore/src/song/events/EncEventVects/EncEventVect.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

template <typename t>
struct EncEventVect {
virtual ~EncEventVect() = default;
std::vector<t> events {};

t& operator=(int event) {
Expand Down
20 changes: 10 additions & 10 deletions Encore/src/song/events/EncEventVects/EventVectors.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
#include "EncEventVect.h"
#include "../EncEvents/EncChartEvents.h"

struct SoloEvents : EncEventVect<solo> {
void UpdateEventViaNote(Note& note, int curEvent) override {
struct SoloEvents final : EncEventVect<solo> {
void UpdateEventViaNote(Note& note, const int curEvent) override {
if (!events.empty()) {
if (note.time >= events[curEvent].StartSec
&& note.time < events[curEvent].EndSec) {
Expand All @@ -23,17 +23,17 @@ struct SoloEvents : EncEventVect<solo> {
}
};

struct FillEvents : EncEventVect<DrumFill> {};
struct FillEvents final : EncEventVect<DrumFill> {};

struct ODEvents : EncEventVect<odPhrase> {
struct ODEvents final : EncEventVect<odPhrase> {
void ResetEvents() override {
for (auto event : events) {
event.NotesHit = 0;
event.added = false;
event.missed = false;
}
}
void UpdateEventViaNote(Note& note, int curEvent) override {
void UpdateEventViaNote(Note& note, const int curEvent) override {
if (!events.empty()) {
if (note.time >= events[curEvent].StartSec
&& note.time < events[curEvent].EndSec) {
Expand All @@ -53,7 +53,7 @@ struct ODEvents : EncEventVect<odPhrase> {
}
}
}
void RenderNotesAsOD(Note& note, int curEvent) {
void RenderNotesAsOD(Note& note, const int curEvent) const {
if (!events.empty()) {
if (note.time >= events[curEvent].StartSec
&& note.time < events[curEvent].EndSec) {
Expand All @@ -65,21 +65,21 @@ struct ODEvents : EncEventVect<odPhrase> {
}
}
}
float AddOverdrive(int phrase) {
float AddOverdrive(const int phrase) {
if (!events.empty()){
if (events[phrase].NoteCount == events[phrase].NotesHit
&& !events[phrase].added
&& !events[phrase].missed) {
events[phrase].added = true;
return 0.25f;
}
return 0;
}
return 0;
}
};

struct SectionEvents : EncEventVect<section> {
void UpdateEventViaNote(Note& note, int curEvent) override {
struct SectionEvents final : EncEventVect<section> {
void UpdateEventViaNote(Note& note, const int curEvent) override {
if (!events.empty()) {
if (note.time >= events[curEvent].StartSec
&& note.time < events[curEvent].EndSec) {
Expand Down

0 comments on commit dbe47f8

Please sign in to comment.