#ifndef Profile_H #define Profile_H /* ----------------------------------------------------------------------------- Class: Profile Desc: Player data that persists between sessions. Can be stored on a local disk or on a memory card. Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved. Chris Danford ----------------------------------------------------------------------------- */ #include "GameConstantsAndTypes.h" #include "Style.h" #include "Grade.h" #include class Steps; class Course; struct HighScore { CString sName; Grade grade; int iScore; float fPercentDP; float fSurviveTime; HighScore() { grade = GRADE_NO_DATA; iScore = 0; fPercentDP = 0; fSurviveTime = 0; } bool operator>=( const HighScore& other ) const; }; struct HighScoreList { int iNumTimesPlayed; vector vHighScores; HighScoreList() { iNumTimesPlayed = 0; } void AddHighScore( HighScore hs, int &iIndexOut ); const HighScore& GetTopScore() const; }; struct Profile { Profile() { Init(); } void Init() { m_sName = ""; m_sLastUsedHighScoreName = ""; m_bUsingProfileDefaultModifiers = false; m_sDefaultModifiers = ""; m_iTotalPlays = 0; m_iTotalPlaySeconds = 0; m_iTotalGameplaySeconds = 0; m_iCurrentCombo = 0; m_fWeightPounds = 0; m_fCaloriesBurned = 0; int i; for( i=0; i m_StepsHighScores; void AddStepsHighScore( const Steps* pSteps, HighScore hs, int &iIndexOut ); HighScoreList& GetStepsHighScoreList( const Steps* pSteps ); int GetStepsNumTimesPlayed( const Steps* pSteps ) const; void IncrementStepsPlayCount( const Steps* pSteps ); // // Course high scores // // struct was a typedef'd array of HighScores, but VC6 freaks out // in processing the templates for map::operator[]. struct HighScoresForACourse { HighScoreList hs[NUM_STEPS_TYPES]; }; std::map m_CourseHighScores; void AddCourseHighScore( const Course* pCourse, StepsType st, HighScore hs, int &iIndexOut ); HighScoreList& GetCourseHighScoreList( const Course* pCourse, StepsType st ); int GetCourseNumTimesPlayed( const Course* pCourse ) const; void IncrementCoursePlayCount( const Course* pCourse, StepsType st ); // // Category high scores // HighScoreList m_CategoryHighScores[NUM_STEPS_TYPES][NUM_RANKING_CATEGORIES]; void AddCategoryHighScore( StepsType st, RankingCategory rc, HighScore hs, int &iIndexOut ); HighScoreList& GetCategoryHighScoreList( StepsType st, RankingCategory rc ); int GetCategoryNumTimesPlayed( RankingCategory rc ) const; void IncrementCategoryPlayCount( StepsType st, RankingCategory rc ); }; #endif