Files
itgmania212121/stepmania/src/Notes.h
T
Chris Danford 189b37b517 Change Nonstop scoring to the DDREX way
Clean up ScreenGameplay by having a Song and Notes Queue (rather than different logic based on the PlayMode)
2003-03-26 23:08:05 +00:00

95 lines
2.9 KiB
C++

#ifndef NOTES_H
#define NOTES_H
/*
-----------------------------------------------------------------------------
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"
#include "Grade.h"
class NoteData;
class Notes
{
public:
Notes();
~Notes();
// initializers
void AutogenFrom( Notes *parent, NotesType ntTo );
void CopyFrom( Notes* pSource, NotesType ntTo );
void CreateBlank( NotesType ntTo );
void Compress() const;
void Decompress() const;
void DeAutogen(); /* If this Notes is autogenerated, make it a real Notes. */
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?
NotesType m_NotesType;
void GetNoteData( NoteData* pNoteDataOut ) const;
void SetNoteData( NoteData* pNewNoteData );
void SetSMNoteData( const CString &out );
CString GetSMNoteData() const;
// High scores
struct MemCardScore
{
int iNumTimesPlayed;
Grade grade;
float fScore;
} m_MemCardScores[NUM_MEMORY_CARDS];
void AddScore( PlayerNumber pn, Grade grade, float fScore, bool& bNewRecordOut );
void TidyUpData();
protected:
/* 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;
/* 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
float m_fRadarValues[NUM_RADAR_CATEGORIES]; // between 0.0-1.2 starting from 12-o'clock rotating clockwise
};
bool CompareNotesPointersByRadarValues(const Notes* pNotes1, const Notes* pNotes2);
bool CompareNotesPointersByMeter(const Notes *pNotes1, const Notes* pNotes2);
bool CompareNotesPointersByDifficulty(const Notes *pNotes1, const Notes *pNotes2);
void SortNotesArrayByDifficulty( vector<Notes*> &arrayNotess );
#endif