* Returns a specific music from the resource set. * @param name Name of the music. * @return Pointer to the music. */
| 139 | * @return Pointer to the music. |
| 140 | */ |
| 141 | Music *ResourcePack::getMusic(const std::string &name) const |
| 142 | { |
| 143 | if (Options::mute) |
| 144 | { |
| 145 | return _muteMusic; |
| 146 | } |
| 147 | else |
| 148 | { |
| 149 | std::map<std::string, Music*>::const_iterator i = _musics.find(name); |
| 150 | if (_musics.end() != i) return i->second; else return 0; |
| 151 | } |
| 152 | } |
| 153 | |
| 154 | /** |
| 155 | * Returns a random music from the resource set. |