aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/misc/SongChance.hpp
diff options
context:
space:
mode:
author Nemrav <>2024-08-01 23:17:24 +0200
committer Nemrav <>2024-08-03 21:32:56 +0200
commit0b4732befaaf4a742acb319256c535eb449668a7 (patch)
treecb7af6c0536e399b8122db6f16985a1f58377c9e /src/openvic-simulation/misc/SongChance.hpp
parent861acff78bd238232ed9e369ea046c2ed4a31198 (diff)
Music and Sound Effect define loadingsim_music
sound and music pr feedback more sound and music style fixes check lookup path
Diffstat (limited to 'src/openvic-simulation/misc/SongChance.hpp')
-rw-r--r--src/openvic-simulation/misc/SongChance.hpp30
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);
+ };
+}
+