Files
itgmania212121/stepmania/src/Steps.h
T

92 lines
3.1 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;
2004-02-10 09:42:01 +00:00
class Profile;
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-12-29 22:50:54 +00:00
void AutogenFrom( const Steps *parent, StepsType ntTo );
2003-08-07 06:16:17 +00:00
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
2004-02-08 01:05:53 +00:00
// Use a special value of difficulty
bool IsAnEdit() const { return m_Difficulty == DIFFICULTY_EDIT; }
bool WasLoadedFromProfile() const { return m_LoadedFromProfile != PROFILE_SLOT_INVALID; }
2004-04-23 00:26:51 +00:00
ProfileSlot GetLoadedFromProfileSlot() const { return m_LoadedFromProfile; }
unsigned GetHash() const { return Real()->m_uHash; }
2003-01-02 22:10:51 +00:00
CString GetDescription() const { return Real()->m_sDescription; }
Difficulty GetDifficulty() const { return Real()->m_Difficulty; }
2004-04-18 21:53:15 +00:00
ProfileSlot GetLoadedFromProfile() const { return m_LoadedFromProfile; }
2003-01-02 22:10:51 +00:00
int GetMeter() const { return Real()->m_iMeter; }
2004-03-12 05:24:32 +00:00
const RadarValues& GetRadarValues() const { return Real()->m_RadarValues; }
2003-01-02 22:10:51 +00:00
void SetDescription(CString desc);
void SetDifficulty(Difficulty d);
2004-04-16 23:47:24 +00:00
void SetLoadedFromProfile( ProfileSlot slot ) { m_LoadedFromProfile = slot; }
2003-01-02 22:10:51 +00:00
void SetMeter(int meter);
void SetRadarValue(int r, float val);
bool IsAutogen() const; // Was created by autogen?
2003-12-18 21:24:30 +00:00
float PredictMeter() const;
2003-12-18 20:35:46 +00:00
2003-11-17 03:38:24 +00:00
StepsType m_StepsType;
2002-05-27 08:23:27 +00:00
2003-11-17 03:38:24 +00:00
void GetNoteData( NoteData* pNoteDataOut ) const;
void SetNoteData( const NoteData* pNewNoteData );
void SetSMNoteData( const CString &notes_comp, const CString &attacks_comp );
void GetSMNoteData( CString &notes_comp_out, CString &attacks_comp_out ) const;
2003-01-30 07:18:33 +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;
2003-11-17 03:38:24 +00:00
struct CompressedNoteData
{
CString notes, attacks;
};
mutable CompressedNoteData *notes_comp;
2003-01-02 22:10:51 +00:00
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. */
2004-02-08 01:05:53 +00:00
ProfileSlot m_LoadedFromProfile; // PROFILE_SLOT_INVALID if wasn't loaded from a profile
unsigned m_uHash; // only used if m_Difficulty == DIFFICULTY_EDIT
2004-02-07 05:57:19 +00:00
CString m_sDescription; // Step author, edit name, or something meaningful
2003-01-02 22:10:51 +00:00
Difficulty m_Difficulty; // difficulty classification
2004-02-07 05:57:19 +00:00
int m_iMeter; // difficulty rating from MIN_METER to MAX_METER
2004-03-12 05:24:32 +00:00
RadarValues m_RadarValues;
2002-05-20 08:59:37 +00:00
};
#endif