Skip to content

Commit

Permalink
kill more obsolete garbage
Browse files Browse the repository at this point in the history
  • Loading branch information
MinaciousGrace committed May 2, 2017
1 parent ec67472 commit c65f4f8
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 83 deletions.
3 changes: 2 additions & 1 deletion src/ChartScores.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,14 @@ struct ScoresForChart
class PlayerScores
{
public:

// at what? rate. Duh. -mina
HighScore* GetChartPBAt(string& ck, float& rate);

// technically "up to and including rate: x" but that's a mouthful -mina
HighScore* GetChartPBUpTo(string& ck, float& rate);

Grade GetBestGradeFor(string& ck) { if (pscores.count(ck)) return pscores[ck].bestGrade; return Grade_Invalid; }

// for scores achieved during this session
void AddScore(const HighScore& hs_) { HighScore hs = hs_; pscores[hs.GetHistoricChartKey()].AddScore(hs); }

Expand Down
13 changes: 6 additions & 7 deletions src/MusicWheelItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -363,18 +363,17 @@ void MusicWheelItem::RefreshGrades()
FOREACH_ENUM_N(Difficulty, 6, i) {
Steps* pSteps = SongUtil::GetStepsByDifficulty(pWID->m_pSong, st, i);
if (pSteps != NULL) {
auto& hsv = pProfile->GetScoresByKey(pSteps->ChartKey);
FOREACH(HighScore, hsv, hs) {
if (gradeBest >= hs->GetWifeGrade()) {
dcBest = i;
gradeBest = hs->GetWifeGrade();
}
Grade dcg = pProfile->pscores.GetBestGradeFor(pSteps->ChartKey);
if (gradeBest >= dcg) {
dcBest = i;
gradeBest = dcg;
}
}
}
}
}
} else {
}
else {
dcBest = dc;
if (PROFILEMAN->IsPersistentProfile(ps) && dc != Difficulty_Invalid)
{
Expand Down
6 changes: 4 additions & 2 deletions src/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -678,8 +678,10 @@ void Player::Load()
nerv = m_NoteData.GetNonEmptyRowVector();

Profile *pProfile = PROFILEMAN->GetProfile(pn);
wifescorepersonalbest = pProfile->GetWifePBByKey(GAMESTATE->m_pCurSteps[pn]->GetChartKey(), GAMESTATE->m_SongOptions.GetCurrent().m_fMusicRate);
if (wifescorepersonalbest == 0)
HighScore* pb = pProfile->pscores.GetChartPBAt(GAMESTATE->m_pCurSteps[pn]->GetChartKey(), GAMESTATE->m_SongOptions.GetCurrent().m_fMusicRate);
if (pb)
wifescorepersonalbest = pb->GetWifeScore();
else
wifescorepersonalbest = m_pPlayerState->playertargetgoal;

if (m_pPlayerStageStats)
Expand Down
23 changes: 0 additions & 23 deletions src/Profile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2400,29 +2400,6 @@ HighScore* ScoreGoal::GetPBUpTo() {
return scores.GetChartPBUpTo(chartkey, rate);
}

// next on the chopping block -mina
vector<HighScore> Profile::GetScoresByKey(RString ck) {
vector<HighScore> o;
if (!HighScoresByChartKey.count(ck))
return o;
auto &hsrm = HighScoresByChartKey.at(ck);
FOREACHM(float, vector<HighScore>, hsrm, zz) {
auto &hsv = zz->second;
for (size_t ii = 0; ii < hsv.size(); ii++) {
o.emplace_back(hsv[ii]); } }
return o;}
// and then this one -mina
float Profile::GetWifePBByKey(RString ck, float rate) {
float o = 0.f;
auto it = HighScoresByChartKey.find(ck);
if (it == HighScoresByChartKey.end())
return o;
auto& hsrm = HighScoresByChartKey.at(ck);
auto iit = hsrm.find(rate);
if (iit == hsrm.end())
return o;
return hsrm.at(rate).at(0).GetWifeScore();}

// aaa too lazy to write comparators rn -mina
ScoreGoal& Profile::GetLowestGoalForRate(RString ck, float rate) {
auto& sgv = goalmap[ck];
Expand Down
50 changes: 0 additions & 50 deletions src/Profile.h
Original file line number Diff line number Diff line change
Expand Up @@ -359,12 +359,6 @@ class Profile
float AggregateScores(vector<float>& invector, float rating, float res, int iter) const;
void ValidateAllScores();

/* Grabbing the highscores here and having lua invoke this results in unhandled exception errors
so instead this funciton finds the song/steps for identical chartkey entries and returns them to
the lua call which then grabs the highscores from the songscores object. -Mina */
void GetScoresByKey(vector<SongID>& songids, vector<StepsID>& stepsids, RString key);
float GetWifePBByKey(RString key, float rate);
HighScore& GetPBHighScoreByKey(RString ck, float rate);
typedef map<float, vector<HighScore>> HighScoreRateMap;
map<RString, HighScoreRateMap> HighScoresByChartKey;
PlayerScores pscores;
Expand Down Expand Up @@ -393,37 +387,6 @@ class Profile
map<DateTime,Calories> m_mapDayToCaloriesBurned;
float GetCaloriesBurnedForDay( DateTime day ) const;

/*
// RecentSongScores
struct HighScoreForASongAndSteps
{
StepsID stepsID;
SongID songID;
HighScore hs;
HighScoreForASongAndSteps() { Unset(); }
void Unset() { stepsID.Unset(); songID.Unset(); hs.Unset(); }
XNode* CreateNode() const;
};
void SaveStepsRecentScore( const Song* pSong, const Steps* pSteps, HighScore hs );
// RecentCourseScores
struct HighScoreForACourseAndTrail
{
CourseID courseID;
TrailID trailID;
HighScore hs;
HighScoreForACourseAndTrail() { Unset(); }
void Unset() { courseID.Unset(); hs.Unset(); }
XNode* CreateNode() const;
};
void SaveCourseRecentScore( const Course* pCourse, const Trail* pTrail, HighScore hs );
*/
// Init'ing
void InitAll()
{
Expand Down Expand Up @@ -494,21 +457,8 @@ class Profile


//TopSSRs
bool CalcTopSSRs(unsigned int qty, int skillset);
bool CalcAllTopSSRs(unsigned int qty);
void TopSSRsAddNewScore(HighScore *hs, StepsID stepsid, SongID songid);
float GetTopSSRMSD(unsigned int rank, int skillset);
HighScore* GetTopSSRHighScore(unsigned int rank, int skillset);
RString GetTopSSRChartkey(unsigned int rank, int skillset);
float GetTopSSRValue(unsigned int rank, int skillset);
Song* GetTopSSRSong(unsigned int rank, int skillset);
Steps* GetTopSSRSteps(unsigned int rank, int skillset);
RString GetTopSSRSongName(unsigned int rank, int skillset);
//Vector array instead of a bunch of vectors
//vector<HighScore*> topSSRHighScores[NUM_Skillset];
vector<vector<HighScore>*> topSSRHighScoreLists[NUM_Skillset];
vector<unsigned int> topSSRHighScoreIndexs[NUM_Skillset];//we work with index+1 so 0 is undefined
vector<RString> topSSRChartkeys[NUM_Skillset];

private:
const HighScoresForASong *GetHighScoresForASong( const SongID& songID ) const;
Expand Down

0 comments on commit c65f4f8

Please sign in to comment.