December 2015
Beginner to intermediate
522 pages
11h 21m
English
In order to prevent sounds or music from playing at inappropriate times, our state manager must notify the sound manager of any state changes:
void StateManager::SwitchTo(const StateType& l_type){
...
m_shared->m_soundManager->ChangeState(l_type);
...
}Since the sound manager also cares about states being removed, let's tell it when that happens:
void StateManager::RemoveState(const StateType& l_type){
for (auto itr = m_states.begin();
itr != m_states.end(); ++itr)
{
if (itr->first == l_type){
...
m_shared->m_soundManager->RemoveState(l_type);
return;
}
}
}The only thing we have left to do now is actually integrating everything we worked on into the rest of our code base, starting with SharedContext.h:
... #include "AudioManager.h" ...
Read now
Unlock full access