Etterna 0.74.4
Loading...
Searching...
No Matches
ReplayConstantsAndTypes.h
1#ifndef REPLAY_CONSTS_H
2#define REPLAY_CONSTS_H
3
4#include "Etterna/Models/Misc/NoteTypes.h"
5
6// contains only tap offset data for rescoring/plots
7const std::string BASIC_REPLAY_DIR = "Save/Replays/";
8
9// contains freeze drops and mine hits as well as tap
10// offsets; fully "rewatchable"
11const std::string FULL_REPLAY_DIR = "Save/ReplaysV2/";
12
13// contains input data files corresponding to replays
14const std::string INPUT_DATA_DIR = "Save/InputData/";
15
16// contains replays to be imported from online
17const std::string ONLINE_DATA_DIR = "Save/OnlineReplays/";
18
19const std::string NO_MODS = "none";
20
22enum ReplayType
23{
24 ReplayType_V0, // ????
25 ReplayType_V1, // contains only note info
26 ReplayType_V2, // contains column info and type info with note info
27 ReplayType_Input, // contains full input data
28 NUM_ReplayType,
29 ReplayType_Invalid,
30};
31
32auto
33ReplayTypeToString(ReplayType replayType) -> const std::string&;
34auto
35StringToReplayType(const std::string& str) -> ReplayType;
36LuaDeclareType(ReplayType);
37
39{
40 bool is_press;
41 int column;
42 // input data saves song seconds here
43 // instead of beats
44 // the reason is that we want it to be able to be parsed by a human
45 // and analyzed externally
46 // beats cant easily be analyzed without song bpm info
47 float songPositionSeconds;
48 int nearestTapNoterow;
49 float offsetFromNearest;
50 TapNoteType nearestTapNoteType = TapNoteType_Invalid;
51 // really only applies for holds and rolls
52 TapNoteSubType nearestTapNoteSubType = TapNoteSubType_Invalid;
53
54 // for inputdata remappings only
55 int reprioritizedNearestNoterow = -1;
56 float reprioritizedOffsetFromNearest = 1.F;
57 TapNoteType reprioritizedNearestTapNoteType = TapNoteType_Invalid;
58 TapNoteSubType reprioritizedNearestTapNoteSubType = TapNoteSubType_Invalid;
59
61 {
62 is_press = false;
63 column = -1;
64 songPositionSeconds = 0.F;
65 nearestTapNoterow = 0;
66 offsetFromNearest = 0.F;
67 }
68
69 InputDataEvent(bool press,
70 int col,
71 float songPos,
72 int row,
73 float offset,
74 TapNoteType tapnotetype,
75 TapNoteSubType tapnotesubtype)
76 : is_press(press)
77 , column(col)
78 , songPositionSeconds(songPos)
79 , nearestTapNoterow(row)
80 , offsetFromNearest(offset)
81 , nearestTapNoteType(tapnotetype)
82 , nearestTapNoteSubType(tapnotesubtype)
83 {
84 }
85
86 InputDataEvent(const InputDataEvent& other) {
87 is_press = other.is_press;
88 column = other.column;
89 songPositionSeconds = other.songPositionSeconds;
90 nearestTapNoterow = other.nearestTapNoterow;
91 offsetFromNearest = other.offsetFromNearest;
92 nearestTapNoteType = other.nearestTapNoteType;
93 nearestTapNoteSubType = other.nearestTapNoteSubType;
94 reprioritizedNearestNoterow = other.reprioritizedNearestNoterow;
95 reprioritizedOffsetFromNearest = other.reprioritizedOffsetFromNearest;
96 reprioritizedNearestTapNoteType = other.reprioritizedNearestTapNoteType;
97 reprioritizedNearestTapNoteSubType =
98 other.reprioritizedNearestTapNoteSubType;
99 }
100
102 void PushSelf(lua_State* L);
103};
104
106{
107 int row;
108 int track; // column
109
111 {
112 row = 0;
113 track = 0;
114 }
115};
116
118{
119 int row;
120 int track; // column
121 TapNoteType tapNoteType = TapNoteType_Invalid;
122 TapNoteSubType tapNoteSubType = TapNoteSubType_Invalid;
123
125 {
126 row = 0;
127 track = 0;
128 }
129
130 MissReplayResult(int row,
131 int col,
132 TapNoteType tapnotetype,
133 TapNoteSubType tapnotesubtype)
134 : row(row)
135 , track(col)
136 , tapNoteType(tapnotetype)
137 , tapNoteSubType(tapnotesubtype)
138 {
139 }
140};
141
143{
144 int row;
145 int track; // column
146 TapNoteSubType subType;
147
149 {
150 row = 0;
151 track = 0;
152 subType = TapNoteSubType_Invalid;
153 }
154};
155
157{
158 int row;
159 int track; // column
160 float offset; // 0
161 TapNoteType type; // typically mines, holds, rolls, etc
162
164 {
165 row = 0;
166 track = 0;
167 offset = 0.F;
168 type = TapNoteType_Invalid;
169 }
170
171 TapReplayResult(const TapReplayResult& other) {
172 row = other.row;
173 track = other.track;
174 offset = other.offset;
175 type = other.type;
176 }
177};
178
180{
181 int noterow;
182 float songPositionSeconds;
183 int track; // column
184 bool isPress; // tap or release
185
186 // only applies if the event judges a note
187 // to prevent events triggering wrong judgments
188 int noterowJudged = -1;
189 float offset = 0.F;
190
192 {
193 noterow = 0;
194 songPositionSeconds = 0.F;
195 track = 0;
196 isPress = true;
197 }
198
199 PlaybackEvent(int noterow, float songPositionSeconds, int track, bool isPress)
200 : noterow(noterow)
201 , songPositionSeconds(songPositionSeconds)
202 , track(track)
203 , isPress(isPress)
204 {
205 }
206
207 bool isJudgeEvent() const { return noterowJudged != -1; }
208};
209
210// Basically contains a record for any given noterow of the essential info about
211// the Player But only the info we can simply derive from the given ReplayData
213{
214 // Contains Marv->Miss and Mines Hit
215 int judgments[NUM_TapNoteScore] = { 0 };
216 // Hold note scores
217 int hns[NUM_HoldNoteScore] = { 0 };
218 float curwifescore = 0.F;
219 float maxwifescore = 0.F;
220 float standardDeviation = 0.F;
221 float mean = 0.F;
222
224 void PushSelf(lua_State* L);
225};
226
228{
229 std::map<int, std::vector<TapReplayResult>> trrMap{};
230 std::map<int, std::vector<HoldReplayResult>> hrrMap{};
231
232 // horrible inefficiency :think:
233 std::map<float, std::vector<TapReplayResult>> trrMapByElapsedTime{};
234 std::map<float, std::vector<HoldReplayResult>> hrrMapByElapsedTime{};
235};
236
237#endif
Definition ReplayConstantsAndTypes.h:143
Definition ReplayConstantsAndTypes.h:39
void PushSelf(lua_State *L)
Lua.
Definition ReplayConstantsAndTypes.h:228
Definition ReplayConstantsAndTypes.h:106
Definition ReplayConstantsAndTypes.h:118
Definition ReplayConstantsAndTypes.h:180
Definition ReplayConstantsAndTypes.h:213
void PushSelf(lua_State *L)
Lua.
Definition ReplayConstantsAndTypes.h:157