add variables for workout

This commit is contained in:
Chris Danford
2005-01-31 02:00:00 +00:00
parent ab685bebbf
commit b5cf0b87eb
5 changed files with 70 additions and 2 deletions
+46 -1
View File
@@ -48,6 +48,10 @@ void GameCommand::Init()
m_sSoundPath = "";
m_vsScreensToPrepare.clear();
m_bDeletePreparedScreens = false;
m_iWeightPounds = -1;
m_iAddToAllCourseEntryMeters = -100;
m_iStopCourseAtSeconds = -1;
m_bAutoAdjustMeterDuringCorse = false;
m_bClearBookkeepingData = false;
m_bClearMachineStats = false;
@@ -118,6 +122,14 @@ bool GameCommand::DescribesCurrentMode( PlayerNumber pn ) const
return false;
if( m_SortOrder != SORT_INVALID && GAMESTATE->m_PreferredSortOrder != m_SortOrder )
return false;
if( m_iWeightPounds != -1 && GAMESTATE->m_pPlayerState[pn]->m_iWeightPounds != m_iWeightPounds )
return false;
if( m_iAddToAllCourseEntryMeters != -100 && GAMESTATE->m_iAddToAllCourseEntryMeters != m_iAddToAllCourseEntryMeters )
return false;
if( m_iStopCourseAtSeconds != -1 && GAMESTATE->m_iStopCourseAtSeconds != m_iStopCourseAtSeconds )
return false;
if( m_bAutoAdjustMeterDuringCorse && !GAMESTATE->m_bAutoAdjustMeterDuringCorse )
return false;
return true;
}
@@ -250,6 +262,26 @@ void GameCommand::Load( int iIndex, const Commands& cmds )
}
}
else if( sName == "weight" )
{
m_iWeightPounds = atoi( sValue );
}
else if( sName == "addtoallcourseentrymeters" )
{
m_iAddToAllCourseEntryMeters = atoi( sValue );
}
else if( sName == "stopcourseatseconds" )
{
m_iStopCourseAtSeconds = atoi( sValue );
}
else if( sName == "autoadjustmeterduringcorse" )
{
m_bAutoAdjustMeterDuringCorse = !!atoi( sValue );
}
else if( sName == "unlock" )
{
m_iUnlockIndex = atoi( sValue );
@@ -600,6 +632,15 @@ void GameCommand::Apply( const vector<PlayerNumber> &vpns ) const
UNLOCKMAN->UnlockCode( m_iUnlockIndex );
if( m_sSoundPath != "" )
SOUND->PlayOnce( THEME->GetPathToS( m_sSoundPath ) );
if( m_iWeightPounds != -1 )
FOREACH_CONST( PlayerNumber, vpns, pn )
GAMESTATE->m_pPlayerState[*pn]->m_iWeightPounds = m_iWeightPounds;
if( m_iAddToAllCourseEntryMeters != -100 )
GAMESTATE->m_iAddToAllCourseEntryMeters = m_iAddToAllCourseEntryMeters;
if( m_iStopCourseAtSeconds != -1 )
GAMESTATE->m_iStopCourseAtSeconds = m_iStopCourseAtSeconds;
if( m_bAutoAdjustMeterDuringCorse )
GAMESTATE->m_bAutoAdjustMeterDuringCorse = m_bAutoAdjustMeterDuringCorse;
/* If we're going to stop music, do so before preparing new screens, so we don't
* stop music between preparing screens and loading screens. */
@@ -739,7 +780,11 @@ bool GameCommand::IsZero() const
m_pCharacter != NULL ||
m_CourseDifficulty != DIFFICULTY_INVALID ||
!m_sSongGroup.empty() ||
m_SortOrder != SORT_INVALID
m_SortOrder != SORT_INVALID ||
m_iWeightPounds != -1 ||
m_iAddToAllCourseEntryMeters != -1 ||
m_iStopCourseAtSeconds != -1 ||
m_bAutoAdjustMeterDuringCorse
)
return false;