Changeset 6031 for code/branches/sound3/src/orxonox/MoodManager.cc
- Timestamp:
- Nov 4, 2009, 4:03:03 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/sound3/src/orxonox/MoodManager.cc
r5956 r6031 42 42 { 43 43 RegisterRootObject(MoodManager); 44 moodOld_ = "default"; 44 45 this->setConfigValues(); 45 46 CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(createFunctor(&MoodManager::setMood, this), "setMood")); … … 53 54 { 54 55 SetConfigValue(mood_, "default") 55 .description("Sets the mood for the current level."); 56 .description("Sets the mood for the current level.") 57 .callback(this, &MoodManager::checkMoodValidity); 56 58 } 57 59 58 // sets a new mood 60 /** 61 * Sets the mood 62 * @note TODO: Inform dependent classes of mood change 63 */ 59 64 void MoodManager::setMood(const std::string& mood) { 60 65 ModifyConfigValue(mood_, set, mood); … … 65 70 return mood_; 66 71 } 72 73 void MoodManager::checkMoodValidity() 74 { 75 if(mood_ != "default" && mood_ != "dnb") // Insert new moods here 76 { 77 ResetConfigValue(mood_); 78 } 79 COUT(0) << "MoodManager: Mood now set to " << mood_ << std::endl; 80 return; 81 } 67 82 }
Note: See TracChangeset
for help on using the changeset viewer.