Cleanup.
This commit is contained in:
@@ -343,11 +343,6 @@ void Steps::CreateBlank( StepsType ntTo )
|
|||||||
this->SetNoteData( noteData );
|
this->SetNoteData( noteData );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Steps::IsAutogen() const
|
|
||||||
{
|
|
||||||
return parent != NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Steps::SetDifficultyAndDescription( Difficulty dc, RString sDescription )
|
void Steps::SetDifficultyAndDescription( Difficulty dc, RString sDescription )
|
||||||
{
|
{
|
||||||
DeAutogen();
|
DeAutogen();
|
||||||
@@ -403,7 +398,7 @@ public:
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Register(lua_State *L)
|
static void Register( lua_State *L )
|
||||||
{
|
{
|
||||||
ADD_METHOD( GetStepsType );
|
ADD_METHOD( GetStepsType );
|
||||||
ADD_METHOD( GetDifficulty );
|
ADD_METHOD( GetDifficulty );
|
||||||
|
|||||||
+18
-18
@@ -29,31 +29,31 @@ public:
|
|||||||
void Compress() const;
|
void Compress() const;
|
||||||
void Decompress() const;
|
void Decompress() const;
|
||||||
void DeAutogen(); /* If this Steps is autogenerated, make it a real Steps. */
|
void DeAutogen(); /* If this Steps is autogenerated, make it a real Steps. */
|
||||||
|
bool IsAutogen() const { return parent != NULL; } // Was created by autogen?
|
||||||
|
|
||||||
// Use a special value of difficulty
|
// Use a special value of difficulty
|
||||||
bool IsAnEdit() const { return m_Difficulty == DIFFICULTY_EDIT; }
|
bool IsAnEdit() const { return m_Difficulty == DIFFICULTY_EDIT; }
|
||||||
bool IsAPlayerEdit() const { return m_Difficulty == DIFFICULTY_EDIT && GetLoadedFromProfileSlot() < ProfileSlot_Machine; }
|
bool IsAPlayerEdit() const { return IsAnEdit() && GetLoadedFromProfileSlot() < ProfileSlot_Machine; }
|
||||||
bool WasLoadedFromProfile() const { return m_LoadedFromProfile != ProfileSlot_INVALID; }
|
bool WasLoadedFromProfile() const { return m_LoadedFromProfile != ProfileSlot_INVALID; }
|
||||||
ProfileSlot GetLoadedFromProfileSlot() const { return m_LoadedFromProfile; }
|
ProfileSlot GetLoadedFromProfileSlot() const { return m_LoadedFromProfile; }
|
||||||
unsigned GetHash() const { return Real()->m_uHash; }
|
unsigned GetHash() const { return Real()->m_uHash; }
|
||||||
RString GetDescription() const { return Real()->m_sDescription; }
|
RString GetDescription() const { return Real()->m_sDescription; }
|
||||||
Difficulty GetDifficulty() const { return Real()->m_Difficulty; }
|
Difficulty GetDifficulty() const { return Real()->m_Difficulty; }
|
||||||
int GetMeter() const { return Real()->m_iMeter; }
|
int GetMeter() const { return Real()->m_iMeter; }
|
||||||
const RadarValues& GetRadarValues( PlayerNumber pn ) const { return Real()->m_CachedRadarValues[pn]; }
|
const RadarValues& GetRadarValues( PlayerNumber pn ) const { return Real()->m_CachedRadarValues[pn]; }
|
||||||
|
|
||||||
void SetFilename( RString fn ) { m_sFilename = fn; }
|
void SetFilename( RString fn ) { m_sFilename = fn; }
|
||||||
RString GetFilename() const { return m_sFilename; }
|
RString GetFilename() const { return m_sFilename; }
|
||||||
void SetSavedToDisk( bool b ) { m_bSavedToDisk = b; }
|
void SetSavedToDisk( bool b ) { m_bSavedToDisk = b; }
|
||||||
bool GetSavedToDisk() const { return m_bSavedToDisk; }
|
bool GetSavedToDisk() const { return m_bSavedToDisk; }
|
||||||
|
void SetDifficulty( Difficulty dc ) { SetDifficultyAndDescription( dc, GetDescription() ); }
|
||||||
|
void SetDescription( RString sDescription ) { SetDifficultyAndDescription( this->GetDifficulty(), sDescription ); }
|
||||||
void SetDifficultyAndDescription( Difficulty dc, RString sDescription );
|
void SetDifficultyAndDescription( Difficulty dc, RString sDescription );
|
||||||
void SetDifficulty( Difficulty dc ) { SetDifficultyAndDescription( dc, this->GetDescription() ); }
|
|
||||||
void SetDescription( RString sDescription ) { SetDifficultyAndDescription( this->GetDifficulty(), sDescription ); }
|
|
||||||
static bool MakeValidEditDescription( RString &sPreferredDescription ); // return true if was modified
|
static bool MakeValidEditDescription( RString &sPreferredDescription ); // return true if was modified
|
||||||
|
|
||||||
void SetLoadedFromProfile( ProfileSlot slot ) { m_LoadedFromProfile = slot; }
|
void SetLoadedFromProfile( ProfileSlot slot ) { m_LoadedFromProfile = slot; }
|
||||||
void SetMeter( int meter );
|
void SetMeter( int meter );
|
||||||
void SetCachedRadarValues( const RadarValues v[NUM_PLAYERS] );
|
void SetCachedRadarValues( const RadarValues v[NUM_PLAYERS] );
|
||||||
bool IsAutogen() const; // Was created by autogen?
|
|
||||||
float PredictMeter() const;
|
float PredictMeter() const;
|
||||||
|
|
||||||
void GetNoteData( NoteData& noteDataOut ) const;
|
void GetNoteData( NoteData& noteDataOut ) const;
|
||||||
@@ -69,7 +69,7 @@ public:
|
|||||||
|
|
||||||
StepsType m_StepsType;
|
StepsType m_StepsType;
|
||||||
private:
|
private:
|
||||||
inline const Steps *Real() const { return parent ? parent : this; }
|
inline const Steps *Real() const { return parent ? parent : this; }
|
||||||
|
|
||||||
/* If this Steps is autogenerated, this will point to the autogen
|
/* If this Steps is autogenerated, this will point to the autogen
|
||||||
* source. If this is true, m_sNoteDataCompressed will always be empty. */
|
* source. If this is true, m_sNoteDataCompressed will always be empty. */
|
||||||
@@ -84,9 +84,9 @@ private:
|
|||||||
|
|
||||||
RString m_sFilename;
|
RString m_sFilename;
|
||||||
bool m_bSavedToDisk; // true if this was loaded from disk or has been saved to disk.
|
bool m_bSavedToDisk; // true if this was loaded from disk or has been saved to disk.
|
||||||
|
ProfileSlot m_LoadedFromProfile; // ProfileSlot_INVALID if wasn't loaded from a profile
|
||||||
|
|
||||||
/* These values are pulled from the autogen source first, if there is one. */
|
/* These values are pulled from the autogen source first, if there is one. */
|
||||||
ProfileSlot m_LoadedFromProfile; // ProfileSlot_INVALID if wasn't loaded from a profile
|
|
||||||
unsigned m_uHash; // only used if m_Difficulty == DIFFICULTY_EDIT
|
unsigned m_uHash; // only used if m_Difficulty == DIFFICULTY_EDIT
|
||||||
RString m_sDescription; // Step author, edit name, or something meaningful
|
RString m_sDescription; // Step author, edit name, or something meaningful
|
||||||
Difficulty m_Difficulty; // difficulty classification
|
Difficulty m_Difficulty; // difficulty classification
|
||||||
|
|||||||
Reference in New Issue
Block a user