This commit is contained in:
24
src/resource/xml/sound_entry.hpp
Normal file
24
src/resource/xml/sound_entry.hpp
Normal file
@@ -0,0 +1,24 @@
|
||||
// Handles sound entries in .xml files. "Weight" value determines weight of being randomly selected.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "../audio.hpp"
|
||||
|
||||
namespace game::resource::xml
|
||||
{
|
||||
class SoundEntry
|
||||
{
|
||||
public:
|
||||
Audio sound{};
|
||||
float weight{1.0f};
|
||||
|
||||
inline void play() { sound.play(); };
|
||||
};
|
||||
|
||||
class SoundEntryCollection : public std::vector<SoundEntry>
|
||||
{
|
||||
public:
|
||||
Audio& get();
|
||||
void play();
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user