00001
00002
00003
#ifndef STAGE_STATS_H
00004
#define STAGE_STATS_H
00005
00006
#include "PlayerNumber.h"
00007
#include "GameConstantsAndTypes.h"
00008
#include "Grade.h"
00009
#include "RadarValues.h"
00010
#include <map>
00011
class Song;
00012
class Steps;
00013
class Style;
00014
00015 struct PlayerStageStats
00016 {
00017 PlayerStageStats() {
Init(); }
00018
void Init();
00019
00020
void AddStats(
const PlayerStageStats& other );
00021
00022
Grade GetGrade() const;
00023
float GetPercentDancePoints() const;
00024 vector<
Steps*> vpSteps;
00025 float fAliveSeconds;
00026
00027
00028
00029
00030 bool bFailed;
00031
00032
00033
00034 bool bFailedEarlier;
00035 int iPossibleDancePoints;
00036 int iActualDancePoints;
00037 int iTapNoteScores[NUM_TAP_NOTE_SCORES];
00038 int iHoldNoteScores[NUM_HOLD_NOTE_SCORES];
00039 int iCurCombo;
00040 int iMaxCombo;
00041 int iCurMissCombo;
00042 int iScore;
00043 int iCurMaxScore;
00044 int iMaxScore;
00045 int iBonus;
00046 RadarValues radarPossible;
00047 RadarValues radarActual;
00048 float fSecondsBeforeFail;
00049
00050 int iSongsPassed;
00051 int iSongsPlayed;
00052 int iTotalError;
00053
00054 map<
float,
float> fLifeRecord;
00055
void SetLifeRecordAt(
float fLife,
float fSecond );
00056
void GetLifeRecord(
float *fLifeOut,
int iNumSamples ) const;
00057
float GetLifeRecordAt(
float fSecond ) const;
00058
float GetLifeRecordLerpAt(
float fSecond ) const;
00059
00060 struct
Combo_t
00061 {
00062
00063
00064 float fStartSecond, fSizeSeconds;
00065
00066
00067 int cnt;
00068
00069
00070
00071 int rollover;
00072
00073
00074 int GetStageCnt()
const {
return cnt - rollover; }
00075
00076 Combo_t(): fStartSecond(0), fSizeSeconds(0), cnt(0), rollover(0) { }
00077 bool IsZero()
const {
return fStartSecond < 0; }
00078 };
00079 vector<Combo_t>
ComboList;
00080 float fFirstSecond;
00081 float fLastSecond;
00082
00083
int GetComboAtStartOfStage() const;
00084
bool FullComboOfScore( TapNoteScore tnsAllGreaterOrEqual ) const;
00085 bool FullCombo()
const {
return FullComboOfScore(
TNS_GREAT); }
00086
bool SingleDigitsOfScore( TapNoteScore tnsAllGreaterOrEqual )
const;
00087
bool OneOfScore( TapNoteScore tnsAllGreaterOrEqual )
const;
00088
int GetTotalTaps() const;
00089
float GetPercentageOfTaps( TapNoteScore tns ) const;
00090
void UpdateComboList(
float fSecond,
bool rollover );
00091 Combo_t GetMaxCombo() const;
00092 };
00093
00094 struct
StageStats
00095 {
00096 StageStats() {
Init(); }
00097
void Init();
00098
00099
void AssertValid( PlayerNumber pn )
const;
00100
00101
void AddStats(
const StageStats& other );
00102
00103
bool OnePassed() const;
00104
bool AllFailed() const;
00105
bool AllFailedEarlier() const;
00106
00107
int GetAverageMeter( PlayerNumber pn ) const;
00108
00109 PlayMode playMode;
00110 const
Style* pStyle;
00111 vector<
Song*> vpSongs;
00112 enum { STAGE_INVALID, STAGE_NORMAL, STAGE_EXTRA, STAGE_EXTRA2 } StageType;
00113 float fGameplaySeconds;
00114
00115 PlayerStageStats m_player[
NUM_PLAYERS];
00116 };
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126 extern StageStats g_CurStageStats;
00127 extern vector<StageStats>
g_vPlayedStageStats;
00128
00129
00130
#endif
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155