2002-11-16 08:07:38 +00:00
|
|
|
#ifndef NOTEDATAWITHSCORING_H
|
|
|
|
|
#define NOTEDATAWITHSCORING_H
|
2002-06-23 02:50:33 +00:00
|
|
|
/*
|
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
Class: NoteDataWithScoring
|
|
|
|
|
|
|
|
|
|
Desc: NoteData with scores for each TapNote and HoldNote
|
|
|
|
|
|
|
|
|
|
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
|
|
|
|
Chris Danford
|
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "GameConstantsAndTypes.h"
|
|
|
|
|
#include "NoteData.h"
|
2003-07-24 19:44:59 +00:00
|
|
|
#include "PlayerNumber.h"
|
2003-12-16 06:10:50 +00:00
|
|
|
#include <map>
|
2002-06-23 02:50:33 +00:00
|
|
|
|
2003-12-18 02:34:59 +00:00
|
|
|
class RowTrack: public pair<int,int>
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
RowTrack( const HoldNote &hn ): pair<int,int>( hn.iEndRow, hn.iTrack ) { }
|
|
|
|
|
};
|
|
|
|
|
|
2004-05-07 04:57:29 +00:00
|
|
|
struct HoldNoteResult
|
|
|
|
|
{
|
|
|
|
|
HoldNoteScore hns;
|
|
|
|
|
|
|
|
|
|
/* 1.0 means this HoldNote has full life.
|
|
|
|
|
* 0.0 means this HoldNote is dead
|
|
|
|
|
* When this value hits 0.0 for the first time, m_HoldScore becomes HSS_NG.
|
|
|
|
|
* If the life is > 0.0 when the HoldNote ends, then m_HoldScore becomes HSS_OK. */
|
|
|
|
|
float fLife;
|
|
|
|
|
|
|
|
|
|
/* Last index where fLife was greater than 0. If the tap was missed, this will
|
|
|
|
|
* be the first index of the hold. */
|
|
|
|
|
int iLastHeldRow;
|
|
|
|
|
|
|
|
|
|
HoldNoteResult()
|
|
|
|
|
{
|
|
|
|
|
hns = HNS_NONE;
|
|
|
|
|
fLife = 1.0f;
|
|
|
|
|
iLastHeldRow = 0;
|
|
|
|
|
}
|
|
|
|
|
HoldNoteResult( const HoldNote &hn );
|
|
|
|
|
|
|
|
|
|
float GetLastHeldBeat() const { return NoteRowToBeat(iLastHeldRow); }
|
|
|
|
|
};
|
|
|
|
|
|
2002-12-17 22:05:17 +00:00
|
|
|
class NoteDataWithScoring : public NoteData
|
2002-06-23 02:50:33 +00:00
|
|
|
{
|
2002-12-17 22:05:17 +00:00
|
|
|
// maintain this extra data in addition to the NoteData
|
2002-12-17 23:31:35 +00:00
|
|
|
vector<TapNoteScore> m_TapNoteScores[MAX_NOTE_TRACKS];
|
2004-05-07 04:57:29 +00:00
|
|
|
map<RowTrack, HoldNoteResult> m_HoldNoteScores;
|
2002-12-17 23:12:37 +00:00
|
|
|
|
2003-03-26 19:34:59 +00:00
|
|
|
/* Offset, in seconds, for each tap grade. Negative numbers mean the note
|
|
|
|
|
* was hit early; positive numbers mean it was hit late. These values are
|
|
|
|
|
* only meaningful for graded taps (m_TapNoteScores >= TNS_BOO). */
|
|
|
|
|
vector<float> m_TapNoteOffset[MAX_NOTE_TRACKS];
|
|
|
|
|
|
2003-12-16 06:10:50 +00:00
|
|
|
map<RowTrack, float> m_fHoldNoteLife;
|
2002-06-23 02:50:33 +00:00
|
|
|
|
2002-12-17 23:12:37 +00:00
|
|
|
public:
|
|
|
|
|
NoteDataWithScoring();
|
2002-12-18 22:24:34 +00:00
|
|
|
void Init();
|
2002-12-17 23:12:37 +00:00
|
|
|
|
2002-06-23 02:50:33 +00:00
|
|
|
// statistics
|
2004-05-24 04:26:54 +00:00
|
|
|
int GetNumTapNotesWithScore( TapNoteScore tns, const float fStartBeat = 0, const float fEndBeat = -1 ) const;
|
2003-12-16 02:15:31 +00:00
|
|
|
int GetNumNWithScore( TapNoteScore tns, int MinTaps, const float fStartBeat = 0, const float fEndBeat = -1 ) const;
|
2003-03-26 17:53:31 +00:00
|
|
|
int GetNumHoldNotesWithScore( HoldNoteScore hns, const float fStartBeat = 0, const float fEndBeat = -1 ) const;
|
2003-12-16 02:15:31 +00:00
|
|
|
int GetSuccessfulMines( const float fStartBeat = 0, const float fEndBeat = -1 ) const;
|
2003-12-16 04:00:39 +00:00
|
|
|
int GetSuccessfulHands( const float fStartBeat = 0, const float fEndBeat = -1 ) const;
|
2002-12-18 22:24:34 +00:00
|
|
|
TapNoteScore GetTapNoteScore(unsigned track, unsigned row) const;
|
|
|
|
|
void SetTapNoteScore(unsigned track, unsigned row, TapNoteScore tns);
|
2003-03-26 19:34:59 +00:00
|
|
|
float GetTapNoteOffset(unsigned track, unsigned row) const;
|
|
|
|
|
void SetTapNoteOffset(unsigned track, unsigned row, float offset);
|
2003-12-16 06:10:50 +00:00
|
|
|
|
|
|
|
|
HoldNoteScore GetHoldNoteScore( const HoldNote &hn ) const;
|
|
|
|
|
void SetHoldNoteScore( const HoldNote &hn, HoldNoteScore hns );
|
|
|
|
|
float GetHoldNoteLife( const HoldNote &hn ) const;
|
|
|
|
|
void SetHoldNoteLife( const HoldNote &hn, float f );
|
2004-05-07 04:57:29 +00:00
|
|
|
const HoldNoteResult GetHoldNoteResult( const HoldNote &hn ) const;
|
|
|
|
|
HoldNoteResult *CreateHoldNoteResult( const HoldNote &hn );
|
2002-06-23 02:50:33 +00:00
|
|
|
|
2003-04-10 05:46:31 +00:00
|
|
|
bool IsRowCompletelyJudged(unsigned row) const;
|
2003-03-26 19:34:59 +00:00
|
|
|
TapNoteScore MinTapNoteScore(unsigned row) const;
|
2003-03-27 00:39:17 +00:00
|
|
|
int LastTapNoteScoreTrack(unsigned row) const;
|
2003-03-26 19:34:59 +00:00
|
|
|
TapNoteScore LastTapNoteScore(unsigned row) const;
|
2002-12-17 22:05:17 +00:00
|
|
|
|
2003-07-24 19:44:59 +00:00
|
|
|
float GetActualRadarValue( RadarCategory rv, PlayerNumber pn, float fSongSeconds ) const;
|
2003-07-24 13:35:20 +00:00
|
|
|
|
2003-07-24 19:44:59 +00:00
|
|
|
private:
|
|
|
|
|
float GetActualStreamRadarValue( float fSongSeconds, PlayerNumber pn ) const;
|
|
|
|
|
float GetActualVoltageRadarValue( float fSongSeconds, PlayerNumber pn ) const;
|
|
|
|
|
float GetActualAirRadarValue( float fSongSeconds, PlayerNumber pn ) const;
|
|
|
|
|
float GetActualFreezeRadarValue( float fSongSeconds, PlayerNumber pn ) const;
|
|
|
|
|
float GetActualChaosRadarValue( float fSongSeconds, PlayerNumber pn ) const;
|
2002-06-23 02:50:33 +00:00
|
|
|
};
|
|
|
|
|
|
2002-11-16 08:07:38 +00:00
|
|
|
#endif
|