aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/misc/SongChance.hpp
diff options
context:
space:
mode:
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);
+ };
+}
+