From 0b4732befaaf4a742acb319256c535eb449668a7 Mon Sep 17 00:00:00 2001 From: Nemrav <> Date: Thu, 1 Aug 2024 18:17:24 -0300 Subject: Music and Sound Effect define loading sound and music pr feedback more sound and music style fixes check lookup path --- src/openvic-simulation/misc/SongChance.hpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/openvic-simulation/misc/SongChance.hpp (limited to 'src/openvic-simulation/misc/SongChance.hpp') 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 +#include + +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 IDENTIFIER_REGISTRY(song_chance); + //Songs.txt + public: + bool load_songs_file(ast::NodeCPtr root); + bool parse_scripts(DefinitionManager const& definition_manager); + }; +} + -- cgit v1.2.3-56-ga3b1