aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/misc/SongChance.hpp
blob: f92af7ae1032ca413e840f988b2088ec002fb69d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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);
   };
}