mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-26 18:35:20 +00:00
65cdd489fb
Fixed some types removed useless header applied clang format fixed compile tests fixed clang tidy, and closer to logic before this MR Removed hardcoded refids unless there is a returned value we don't use static RefIds can use == between RefId and hardcoded string Fix clang format Fixed a few instances where std::string was used, when only const std::string& was needed removed unused variable
34 lines
677 B
C++
34 lines
677 B
C++
#ifndef GAME_SOUND_REGIONSOUNDSELECTOR_H
|
|
#define GAME_SOUND_REGIONSOUNDSELECTOR_H
|
|
|
|
#include <components/esm/refid.hpp>
|
|
#include <optional>
|
|
#include <string>
|
|
|
|
namespace MWBase
|
|
{
|
|
class World;
|
|
}
|
|
|
|
namespace MWSound
|
|
{
|
|
class RegionSoundSelector
|
|
{
|
|
public:
|
|
std::optional<ESM::RefId> getNextRandom(
|
|
float duration, const ESM::RefId& regionName, const MWBase::World& world);
|
|
|
|
RegionSoundSelector();
|
|
|
|
private:
|
|
float mTimeToNextEnvSound = 0.0f;
|
|
int mSumChance = 0;
|
|
ESM::RefId mLastRegionName;
|
|
float mTimePassed = 0.0;
|
|
float mMinTimeBetweenSounds;
|
|
float mMaxTimeBetweenSounds;
|
|
};
|
|
}
|
|
|
|
#endif
|