Files
itgmania212121/stepmania/src/Steps.h
T

97 lines
2.9 KiB
C++
Raw Normal View History

2003-08-03 00:57:20 +00:00
#ifndef STEPS_H
#define STEPS_H
2002-05-20 08:59:37 +00:00
/*
-----------------------------------------------------------------------------
2003-08-03 00:57:20 +00:00
Class: Steps
2002-05-20 08:59:37 +00:00
Desc: Holds note information for a Song. A Song may have one or more Notess.
2003-08-03 00:57:20 +00:00
A Steps can be played by one or more Styles. See StyleDef.h for more info on
2002-05-20 08:59:37 +00:00
Styles.
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Chris Danford
-----------------------------------------------------------------------------
*/
#include "GameConstantsAndTypes.h"
#include "PlayerNumber.h"
2002-05-20 08:59:37 +00:00
#include "Grade.h"
2002-07-03 03:13:13 +00:00
class NoteData;
2002-05-20 08:59:37 +00:00
2003-08-03 00:57:20 +00:00
class Steps
2002-05-20 08:59:37 +00:00
{
public:
2003-08-03 00:57:20 +00:00
Steps();
~Steps();
2002-05-20 08:59:37 +00:00
// initializers
2003-08-07 06:16:17 +00:00
void AutogenFrom( Steps *parent, StepsType ntTo );
void CopyFrom( Steps* pSource, StepsType ntTo );
void CreateBlank( StepsType ntTo );
2002-12-14 21:43:00 +00:00
void Compress() const;
void Decompress() const;
2003-08-03 00:57:20 +00:00
void DeAutogen(); /* If this Steps is autogenerated, make it a real Steps. */
2002-12-14 21:43:00 +00:00
2003-01-02 22:10:51 +00:00
CString GetDescription() const { return Real()->m_sDescription; }
Difficulty GetDifficulty() const { return Real()->m_Difficulty; }
int GetMeter() const { return Real()->m_iMeter; }
const float *GetRadarValues() const { return Real()->m_fRadarValues; }
void SetDescription(CString desc);
void SetDifficulty(Difficulty d);
void SetMeter(int meter);
void SetRadarValue(int r, float val);
bool IsAutogen() const; // Was created by autogen?
2003-08-07 06:36:34 +00:00
StepsType m_StepsType;
2002-05-27 08:23:27 +00:00
void GetNoteData( NoteData* pNoteDataOut ) const;
2002-07-03 03:13:13 +00:00
void SetNoteData( NoteData* pNewNoteData );
2002-12-14 21:33:29 +00:00
void SetSMNoteData( const CString &out );
CString GetSMNoteData() const;
2003-01-30 07:18:33 +00:00
2003-01-22 05:29:27 +00:00
// High scores
struct MemCardScore
2003-01-22 05:29:27 +00:00
{
int iNumTimesPlayed;
2003-01-22 05:29:27 +00:00
Grade grade;
2003-06-18 20:06:27 +00:00
int iScore;
2003-07-28 18:23:16 +00:00
bool HigherScore( int iScore, Grade grade ) const;
} m_MemCardScores[NUM_MEMORY_CARDS];
2003-01-22 05:29:27 +00:00
2003-06-18 20:08:39 +00:00
void AddScore( PlayerNumber pn, Grade grade, int iScore, bool& bNewRecordOut );
2003-01-22 05:29:27 +00:00
2002-07-03 03:13:13 +00:00
void TidyUpData();
2002-09-06 23:36:04 +00:00
protected:
2003-08-03 00:57:20 +00:00
/* If this Steps is autogenerated, this will point to the autogen
2003-01-02 22:10:51 +00:00
* source. If this is true, notes_comp will always be NULL. */
2003-08-03 00:57:20 +00:00
const Steps *parent;
2002-09-06 23:36:04 +00:00
2003-01-02 22:10:51 +00:00
/* We can have one or both of these; if we have both, they're always identical.
* Call Compress() to force us to only have notes_comp; otherwise, creation of
* these is transparent. */
mutable NoteData *notes;
mutable CString *notes_comp;
2003-08-03 00:57:20 +00:00
const Steps *Real() const;
2003-01-02 22:10:51 +00:00
/* These values are pulled from the autogen source first, if there is one. */
CString m_sDescription; // This text is displayed next to the number of feet when a song is selected
Difficulty m_Difficulty; // difficulty classification
int m_iMeter; // difficulty rating from 1-10
2003-01-30 07:18:33 +00:00
float m_fRadarValues[NUM_RADAR_CATEGORIES]; // between 0.0-1.2 starting from 12-o'clock rotating clockwise
2003-01-02 22:10:51 +00:00
2002-05-20 08:59:37 +00:00
};
2003-08-03 00:57:20 +00:00
bool CompareNotesPointersByRadarValues(const Steps* pNotes1, const Steps* pNotes2);
bool CompareNotesPointersByMeter(const Steps *pNotes1, const Steps* pNotes2);
bool CompareNotesPointersByDifficulty(const Steps *pNotes1, const Steps *pNotes2);
void SortNotesArrayByDifficulty( vector<Steps*> &arrayNotess );
#endif