Files
shweets-sim/src/resource/xml/sound_entry.cpp
shweet 17f3348e94
Some checks failed
Build / Build Game (push) Has been cancelled
The Mega Snivy Update
2026-02-28 21:48:00 -05:00

17 lines
406 B
C++

#include "sound_entry.hpp"
#include "../../util/vector.hpp"
namespace game::resource::xml
{
Audio& SoundEntryCollection::get()
{
return at(util::vector::random_index_weighted(*this, [](const auto& entry) { return entry.weight; })).sound;
}
void SoundEntryCollection::play()
{
at(util::vector::random_index_weighted(*this, [](const auto& entry) { return entry.weight; })).play();
}
}