2002-05-20 08:59:37 +00:00
|
|
|
#pragma once
|
|
|
|
|
/*
|
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
Class: Notes
|
|
|
|
|
|
|
|
|
|
Desc: Holds note information for a Song. A Song may have one or more Notess.
|
|
|
|
|
A Notes can be played by one or more Styles. See StyleDef.h for more info on
|
|
|
|
|
Styles.
|
|
|
|
|
|
|
|
|
|
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
|
|
|
|
Chris Danford
|
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "GameConstantsAndTypes.h"
|
|
|
|
|
#include "Grade.h"
|
|
|
|
|
#include "NoteData.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct Notes
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
Notes();
|
|
|
|
|
~Notes();
|
|
|
|
|
|
|
|
|
|
// Loading
|
|
|
|
|
bool LoadFromNotesFile( const CString &sPath );
|
|
|
|
|
bool LoadFromBMSFile( const CString &sPath );
|
|
|
|
|
bool LoadFromDWITokens( const CString &sMode, const CString &sDescription,
|
2002-06-24 22:04:31 +00:00
|
|
|
const int &iNumFeet,
|
2002-05-20 08:59:37 +00:00
|
|
|
const CString &sStepData1, const CString &sStepData2 );
|
|
|
|
|
void ReadFromCacheFile( FILE* file, bool bReadNoteData );
|
|
|
|
|
|
|
|
|
|
// for saving
|
|
|
|
|
void SaveToSMDir( CString sSongDir );
|
|
|
|
|
void WriteToCacheFile( FILE* file );
|
|
|
|
|
|
2002-05-27 08:23:27 +00:00
|
|
|
//
|
|
|
|
|
|
2002-05-20 08:59:37 +00:00
|
|
|
public:
|
2002-05-27 08:23:27 +00:00
|
|
|
NotesType m_NotesType;
|
2002-05-20 08:59:37 +00:00
|
|
|
CString m_sDescription; // This text is displayed next to thte number of feet when a song is selected
|
|
|
|
|
CString m_sCredit; // name of the person who created these Notes
|
|
|
|
|
DifficultyClass m_DifficultyClass; // this is inferred from m_sDescription
|
2002-05-27 08:23:27 +00:00
|
|
|
|
|
|
|
|
// Color is a function of DifficultyClass and Intended Style
|
|
|
|
|
D3DXCOLOR GetColor()
|
|
|
|
|
{
|
|
|
|
|
CString sDescription = m_sDescription;
|
|
|
|
|
sDescription.MakeLower();
|
|
|
|
|
|
|
|
|
|
if( -1 != sDescription.Find("battle") )
|
|
|
|
|
return D3DXCOLOR(1,0.5f,0,1); // orange
|
|
|
|
|
else if( -1 != m_sDescription.Find("couple") )
|
|
|
|
|
return D3DXCOLOR(0,0,1,1); // blue
|
|
|
|
|
else
|
|
|
|
|
return DifficultyClassToColor( m_DifficultyClass );
|
|
|
|
|
}
|
|
|
|
|
|
2002-05-20 08:59:37 +00:00
|
|
|
int m_iMeter; // difficulty from 1-10
|
|
|
|
|
float m_fRadarValues[NUM_RADAR_VALUES]; // between 0.0-1.2 starting from 12-o'clock rotating clockwise
|
|
|
|
|
|
|
|
|
|
// Statistics
|
|
|
|
|
Grade m_TopGrade;
|
|
|
|
|
int m_iTopScore;
|
|
|
|
|
int m_iMaxCombo;
|
|
|
|
|
int m_iNumTimesPlayed;
|
|
|
|
|
|
|
|
|
|
bool IsNoteDataLoaded();
|
|
|
|
|
NoteData* GetNoteData();
|
|
|
|
|
void SetNoteData( NoteData* pNewNoteData );
|
|
|
|
|
void DeleteNoteData();
|
|
|
|
|
|
|
|
|
|
protected:
|
2002-06-27 17:49:10 +00:00
|
|
|
static DifficultyClass DifficultyClassFromDescriptionAndMeter( CString sDifficulty, int iMeter );
|
|
|
|
|
|
|
|
|
|
|
2002-05-20 08:59:37 +00:00
|
|
|
NoteData* m_pNoteData;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void SortNotesArrayByDifficultyClass( CArray<Notes*,Notes*> &arrayNotess );
|