diff options
author | Nemrav <50055236+Nemrav@users.noreply.github.com> | 2024-08-03 21:38:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-03 21:38:25 +0200 |
commit | adc7eb8ad07170ba8da18f684321a92d01447c2c (patch) | |
tree | eedd074580ff5a81b4eff4b8bc43163b7cf59f0e /src/openvic-simulation/misc/SongChance.hpp | |
parent | 1f42a6255226b79d271df5060a8391f4ea00fc0a (diff) | |
parent | 0b4732befaaf4a742acb319256c535eb449668a7 (diff) |
Merge pull request #181 from OpenVicProject/sim_music
Music and Sound Effect define loading
Diffstat (limited to 'src/openvic-simulation/misc/SongChance.hpp')
-rw-r--r-- | src/openvic-simulation/misc/SongChance.hpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/openvic-simulation/misc/SongChance.hpp b/src/openvic-simulation/misc/SongChance.hpp new file mode 100644 index 0000000..f92af7a --- /dev/null +++ b/src/openvic-simulation/misc/SongChance.hpp @@ -0,0 +1,30 @@ +#pragma once + +#include <openvic-simulation/types/IdentifierRegistry.hpp> +#include <openvic-simulation/scripts/ConditionalWeight.hpp> + +namespace OpenVic { + /*For music/Songs.txt if it exists*/ + struct SongChanceManager; + struct SongChance : HasIdentifier { + private: + friend struct SongChanceManager; + std::string PROPERTY(file_name); + ConditionalWeight PROPERTY(chance); + SongChance(size_t new_index, std::string_view new_filename, ConditionalWeight&& new_chance); + bool parse_scripts(DefinitionManager const& definition_manager); + + public: + SongChance(SongChance&&) = default; + }; + + struct SongChanceManager { + private: + IdentifierRegistry<SongChance> IDENTIFIER_REGISTRY(song_chance); + //Songs.txt + public: + bool load_songs_file(ast::NodeCPtr root); + bool parse_scripts(DefinitionManager const& definition_manager); + }; +} + |