5 #ifndef AZERITE_DATA_HPP     6 #define AZERITE_DATA_HPP     9 #include <unordered_map>    12 #include "util/util.hpp"    13 #include "rapidjson/document.h"    14 #include "report/reports.hpp"    16 #include "util/timespan.hpp"    31 class azerite_state_t;
    49   std::vector<unsigned>       m_ilevels;
    51   mutable std::vector<double> m_value;
    56   bool check_combat_rating_penalty( 
size_t index = 1 ) 
const;
    65   using azerite_value_fn_t = std::function<double(const azerite_power_t&)>;
    84   double value( 
size_t index = 1 ) 
const;
    86   double value( 
const azerite_value_fn_t& fn ) 
const;
    90   double percent( 
size_t index = 1 ) 
const;
    92   std::vector<double> budget( 
size_t index ) 
const;
    98   std::vector<unsigned> ilevels() 
const;
   100   unsigned n_items() 
const;
   105 enum class essence_type : unsigned
   113 enum class essence_spell : unsigned
   126   std::vector<const spell_data_t*>         m_base_major, m_base_minor;
   128   std::vector<const spell_data_t*>         m_upgrade_major, m_upgrade_minor;
   145   bool enabled() 
const;
   150   const char* name() 
const;
   152   unsigned rank()
 const   155   bool is_minor()
 const   156   { 
return m_type == essence_type::MINOR; }
   158   bool is_major()
 const   159   { 
return m_type == essence_type::MAJOR; }
   161   bool is_passive()
 const   162   { 
return m_type == essence_type::PASSIVE; }
   168   const spell_data_t* spell( 
unsigned rank, essence_spell s, essence_type t = essence_type::INVALID ) 
const;
   170   const spell_data_t* spell( 
unsigned rank, essence_type t = essence_type::INVALID ) 
const;
   172   const spell_data_t& spell_ref( 
unsigned rank, essence_spell s, essence_type t = essence_type::INVALID ) 
const;
   174   const spell_data_t& spell_ref( 
unsigned rank, essence_type t = essence_type::INVALID ) 
const;
   176   std::vector<const spell_data_t*> 
spells( essence_spell s = essence_spell::BASE, essence_type t = essence_type::INVALID ) 
const;
   190   std::unordered_map<unsigned, std::vector<const item_t*>> m_items;
   192   std::unordered_map<unsigned, std::vector<const item_t*>> m_spell_items;
   194   std::unordered_map<unsigned, std::vector<unsigned>> m_overrides;
   207   azerite_power_t get_power( util::string_view name, 
bool tokenized = 
false );
   210   bool is_enabled( 
unsigned id ) 
const;
   212   bool is_enabled( util::string_view name, 
bool tokenized = 
false ) 
const;
   214   size_t rank( 
unsigned id ) 
const;
   216   size_t rank( util::string_view name, 
bool tokenized = 
false ) 
const;
   219   bool parse_override( 
sim_t*, util::string_view , util::string_view  );
   221   std::string overrides_str() 
const;
   223   void copy_overrides( 
const std::unique_ptr<azerite_state_t>& other );
   226   std::unique_ptr<expr_t> create_expression( util::span<const util::string_view> expr_str ) 
const;
   229   std::vector<unsigned> enabled_spells() 
const;
   244       slot_state_t() : m_type( essence_type::INVALID ), m_id( 0u ), m_rank( 0u )
   247       slot_state_t( essence_type t, 
unsigned id, 
unsigned rank ) :
   248         m_type( t ), m_id( 
id ), m_rank( rank )
   251       unsigned rank()
 const   255       { 
return rank() != 0; }
   260       essence_type type()
 const   263       std::string str()
 const   267                ( type() == essence_type::MAJOR ? 
'1' : 
'0' );
   272   std::vector<slot_state_t> m_state;
   273   std::string               m_option_str;
   279   azerite_essence_t get_essence( util::string_view name, 
bool tokenized = 
false ) 
const;
   282   bool add_essence( essence_type type, 
unsigned id, 
unsigned rank );
   285   void copy_state( 
const std::unique_ptr<azerite_essence_state_t>& other );
   287   bool parse_azerite_essence( 
sim_t*, util::string_view , util::string_view  );
   290   std::unique_ptr<expr_t> create_expression( util::span<const util::string_view> expr_str ) 
const;
   292   std::vector<unsigned> enabled_essences() 
const;
   294   std::string option_str() 
const;
   296   void update_traversal_nodes();
   303 std::unique_ptr<azerite_state_t> create_state( 
player_t* );
   305 std::unique_ptr<azerite_essence_state_t> create_essence_state( 
player_t* );
   307 void initialize_azerite_powers( 
player_t* actor );
   309 void initialize_azerite_essences( 
player_t* actor );
   311 void register_azerite_powers();
   313 void register_azerite_target_data_initializers( 
sim_t* );
   315 action_t* create_action( 
player_t* p, util::string_view name, util::string_view options );
   322 void parse_blizzard_azerite_information( 
item_t& 
item, 
const rapidjson::Value& data );
   324 namespace special_effects
   381 namespace azerite_essences
 Definition: azerite.hpp:12
 
Definition: azerite.hpp:29
 
Definition: sc_druid.cpp:2641
 
Definition: spell_data.hpp:398
 
Definition: action.hpp:47
 
Definition: unique_gear.cpp:62
 
std::string to_string(const T &t)
Converts value to std::string using the default format for type T. 
Definition: util.hpp:238
 
A class representing a single azerite power and the actors items associated with the power...
Definition: azerite_data.hpp:42
 
time_type
Time type conversion for azerite_power_t::time_value. 
Definition: azerite_data.hpp:59
 
Definition: azerite_data.hpp:235
 
Class for representing InGame time. 
Definition: timespan.hpp:37
 
Definition: player.hpp:109
 
Action expression. 
Definition: expressions.hpp:79
 
Definition: spell_data.hpp:145
 
Definition: sc_demon_hunter.cpp:52
 
A state class that holds the composite of all azerite-related state an actor has. ...
Definition: azerite_data.hpp:185
 
Simulation engine. 
Definition: sim.hpp:61
 
Definition: azerite_data.cpp:339
 
Definition: azerite_data.hpp:119
 
Definition: special_effect.hpp:39