00001 /* Steps - Holds note information for a Song. A Song may have one or more Notes. */ 00002 00003 #ifndef STEPS_H 00004 #define STEPS_H 00005 00006 #include "GameConstantsAndTypes.h" 00007 #include "PlayerNumber.h" 00008 #include "Grade.h" 00009 #include "RadarValues.h" 00010 #include "Difficulty.h" 00011 class NoteData; 00012 class Profile; 00013 00014 class Steps 00015 { 00016 public: 00017 Steps(); 00018 ~Steps(); 00019 00020 // initializers 00021 void AutogenFrom( const Steps *parent, StepsType ntTo ); 00022 void CopyFrom( Steps* pSource, StepsType ntTo ); 00023 void CreateBlank( StepsType ntTo ); 00024 00025 void Compress() const; 00026 void Decompress() const; 00027 void DeAutogen(); /* If this Steps is autogenerated, make it a real Steps. */ 00028 00029 // Use a special value of difficulty 00030 bool IsAnEdit() const { return m_Difficulty == DIFFICULTY_EDIT; } 00031 bool WasLoadedFromProfile() const { return m_LoadedFromProfile != PROFILE_SLOT_INVALID; } 00032 ProfileSlot GetLoadedFromProfileSlot() const { return m_LoadedFromProfile; } 00033 unsigned GetHash() const { return Real()->m_uHash; } 00034 CString GetDescription() const { return Real()->m_sDescription; } 00035 Difficulty GetDifficulty() const { return Real()->m_Difficulty; } 00036 ProfileSlot GetLoadedFromProfile() const { return m_LoadedFromProfile; } 00037 int GetMeter() const { return Real()->m_iMeter; } 00038 const RadarValues& GetRadarValues() const { return Real()->m_RadarValues; } 00039 00040 void SetFile( CString fn ); 00041 void SetDescription(CString desc); 00042 void SetDifficulty(Difficulty d); 00043 void SetLoadedFromProfile( ProfileSlot slot ) { m_LoadedFromProfile = slot; } 00044 void SetMeter(int meter); 00045 void SetRadarValues( const RadarValues& v ); 00046 bool IsAutogen() const; // Was created by autogen? 00047 float PredictMeter() const; 00048 00049 StepsType m_StepsType; 00050 00051 void GetNoteData( NoteData& noteDataOut ) const; 00052 void SetNoteData( const NoteData& noteDataNew ); 00053 void SetSMNoteData( const CString ¬es_comp ); 00054 void GetSMNoteData( CString ¬es_comp_out ) const; 00055 00056 void TidyUpData(); 00057 00058 protected: 00059 /* If this Steps is autogenerated, this will point to the autogen 00060 * source. If this is true, notes_comp will always be NULL. */ 00061 const Steps *parent; 00062 00063 /* We can have one or both of these; if we have both, they're always identical. 00064 * Call Compress() to force us to only have notes_comp; otherwise, creation of 00065 * these is transparent. */ 00066 mutable NoteData *notes; 00067 mutable CString notes_comp; 00068 00069 const Steps *Real() const; 00070 00071 CString m_sFilename; 00072 00073 /* These values are pulled from the autogen source first, if there is one. */ 00074 ProfileSlot m_LoadedFromProfile; // PROFILE_SLOT_INVALID if wasn't loaded from a profile 00075 unsigned m_uHash; // only used if m_Difficulty == DIFFICULTY_EDIT 00076 CString m_sDescription; // Step author, edit name, or something meaningful 00077 Difficulty m_Difficulty; // difficulty classification 00078 int m_iMeter; // difficulty rating from MIN_METER to MAX_METER 00079 RadarValues m_RadarValues; 00080 }; 00081 00082 #endif 00083 00084 /* 00085 * (c) 2001-2004 Chris Danford, Glenn Maynard 00086 * All rights reserved. 00087 * 00088 * Permission is hereby granted, free of charge, to any person obtaining a 00089 * copy of this software and associated documentation files (the 00090 * "Software"), to deal in the Software without restriction, including 00091 * without limitation the rights to use, copy, modify, merge, publish, 00092 * distribute, and/or sell copies of the Software, and to permit persons to 00093 * whom the Software is furnished to do so, provided that the above 00094 * copyright notice(s) and this permission notice appear in all copies of 00095 * the Software and that both the above copyright notice(s) and this 00096 * permission notice appear in supporting documentation. 00097 * 00098 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 00099 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00100 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF 00101 * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS 00102 * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT 00103 * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS 00104 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 00105 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 00106 * PERFORMANCE OF THIS SOFTWARE. 00107 */