wavelength 1.0.0
Loading...
Searching...
No Matches
difficultyrating.h
Go to the documentation of this file.
1#pragma once
2
3#include <vector>
4
7#include "game/rateaverager.h"
8
20public:
22 static constexpr int kNumSlots = 4;
23
33 DifficultyRating(float fTempo, int nNumBars, int nTicksPerBar);
34
43
56 float GapDifficulty(int nTick, bool bSameLane, float fGapMs) const;
57
65 void BeginTrack(int nSlot);
66
75 void AddGem(int nLane, int nTick);
76
84 int EndTrack();
85
95 int RateCatchTrack(const CatchTrackData *pData, int nSlot);
96
106
116
126
134 float GetDifficulty() const;
135
143 float GetEmptyFraction() const;
144
145private:
146 float mTempo;
147 float mMsPerTick;
148 int mNumBars;
149 int mTicksPerBar;
150 float mDifficulty;
151 int mNumTracks;
152 int mGemBars;
153 RateAverager mRateAverager;
154 int mSlot;
155 int mBar;
156 int mLastLane;
157 int mLastTick;
158 int mTrackGemBars;
159 std::vector<float> mBarGaps;
160 float mTrackDifficulty;
161 std::vector<int> mBarDifficulties[kNumSlots];
162};
The gems of one catch track, in the order of their ticks.
Definition catchtrackdata.h:14
static constexpr int kNumSlots
Number of sets of bar difficulties the rating records.
Definition difficultyrating.h:22
int GetSkillTier()
Report the skill tier of the rating from the "skill_thresholds" entry of the "game" section of the co...
float GapDifficulty(int nTick, bool bSameLane, float fGapMs) const
Report the difficulty of a gap between two gems.
void BeginTrack(int nSlot)
Start rating a track.
~DifficultyRating()
Release the rating.
Definition difficultyrating.h:41
int RateCatchTrack(const CatchTrackData *pData, int nSlot)
Rate the gems of a catch track.
void AddGem(int nLane, int nTick)
Rate the next gem of the track, closing the previous bar when the gem starts a new one.
int EndTrack()
Finish rating a track and add its mean bar difficulty to the rating.
int RatePitchTrack(PitchTrackGems *pGems)
Rate the gems of a pitch track into the first set of bar difficulties.
bool IsBelowEmptyThreshold()
Report whether the fraction of bars without gems is below the "empty_threshold" entry of the "game" s...
float GetEmptyFraction() const
Report the fraction of the bars of the rated tracks without gems.
float GetDifficulty() const
Report the sum of the mean bar difficulties of the rated tracks.
DifficultyRating(float fTempo, int nNumBars, int nTicksPerBar)
Construct a rating with no tracks rated.
The gems of a pitch track, by the bar of the song as written they lie in.
Definition pitchtrackgems.h:17
Average of the rate of the gems of one bar.
Definition rateaverager.h:9