2020-06-28 11:12:42 +00:00
|
|
|
#ifndef GAME_SOUND_REGIONSOUNDSELECTOR_H
|
|
|
|
#define GAME_SOUND_REGIONSOUNDSELECTOR_H
|
|
|
|
|
2020-10-24 22:58:44 +00:00
|
|
|
#include <optional>
|
2020-06-28 11:12:42 +00:00
|
|
|
#include <string>
|
|
|
|
|
|
|
|
namespace MWBase
|
|
|
|
{
|
|
|
|
class World;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace MWSound
|
|
|
|
{
|
|
|
|
class RegionSoundSelector
|
|
|
|
{
|
|
|
|
public:
|
2020-10-24 22:33:41 +00:00
|
|
|
std::optional<std::string> getNextRandom(float duration, const std::string& regionName,
|
2020-06-28 11:12:42 +00:00
|
|
|
const MWBase::World& world);
|
|
|
|
|
2020-10-24 16:54:46 +00:00
|
|
|
RegionSoundSelector();
|
|
|
|
|
2020-06-28 11:12:42 +00:00
|
|
|
private:
|
|
|
|
float mTimeToNextEnvSound = 0.0f;
|
|
|
|
int mSumChance = 0;
|
|
|
|
std::string mLastRegionName;
|
|
|
|
float mTimePassed = 0.0;
|
2020-10-24 16:54:46 +00:00
|
|
|
float mMinTimeBetweenSounds;
|
|
|
|
float mMaxTimeBetweenSounds;
|
2020-06-28 11:12:42 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|