Files
itgmania212121/stepmania/src/Notes.h
T

95 lines
2.9 KiB
C++
Raw Normal View History

#ifndef NOTES_H
#define NOTES_H
2002-05-20 08:59:37 +00:00
/*
-----------------------------------------------------------------------------
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 "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-03-26 23:08:05 +00:00
class Notes
2002-05-20 08:59:37 +00:00
{
public:
Notes();
~Notes();
// initializers
void AutogenFrom( Notes *parent, NotesType ntTo );
void CopyFrom( Notes* pSource, NotesType ntTo );
void CreateBlank( NotesType ntTo );
2002-12-14 21:43:00 +00:00
void Compress() const;
void Decompress() const;
void DeAutogen(); /* If this Notes is autogenerated, make it a real Notes. */
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?
2002-05-27 08:23:27 +00:00
NotesType m_NotesType;
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;
float fScore;
} m_MemCardScores[NUM_MEMORY_CARDS];
2003-01-22 05:29:27 +00:00
void AddScore( PlayerNumber pn, Grade grade, float fScore, 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-01-02 22:10:51 +00:00
/* If this Notes is autogenerated, this will point to the autogen
* source. If this is true, notes_comp will always be NULL. */
const Notes *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;
const Notes *Real() const;
/* 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
};
bool CompareNotesPointersByRadarValues(const Notes* pNotes1, const Notes* pNotes2);
bool CompareNotesPointersByMeter(const Notes *pNotes1, const Notes* pNotes2);
2002-10-24 08:17:09 +00:00
bool CompareNotesPointersByDifficulty(const Notes *pNotes1, const Notes *pNotes2);
2003-01-03 05:56:28 +00:00
void SortNotesArrayByDifficulty( vector<Notes*> &arrayNotess );
#endif