diff options
author | Manoj Srivastava <srivasta@debian.org> | 2020-05-23 00:33:19 -0700 |
---|---|---|
committer | Manoj Srivastava <srivasta@debian.org> | 2020-05-23 00:33:19 -0700 |
commit | d6b913d3ca2e84b75f3675fd6e9f5246c100cf27 (patch) | |
tree | 5fc28b7efc737bf2c79dc7d799e0a6013957fe11 /src/monster_spell.cc | |
parent | c42f029316c0c004a795ca170bdb50644a800534 (diff) | |
parent | 73a0259be1d44fdb2ab34266ae0ff63f0d8f0b60 (diff) |
Merge branch 'master' into dgit/siddebian/2.4.0-ah-1archive/debian/2.4.0-ah-1
Diffstat (limited to 'src/monster_spell.cc')
-rw-r--r-- | src/monster_spell.cc | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/monster_spell.cc b/src/monster_spell.cc new file mode 100644 index 00000000..08627916 --- /dev/null +++ b/src/monster_spell.cc @@ -0,0 +1,36 @@ +#include "monster_spell.hpp" + +#include "monster_spell_flag.hpp" + +#include <boost/preprocessor/cat.hpp> + +std::vector<monster_spell const *> const &monster_spells() +{ + // Static instance for one-time initialization. + static std::vector<monster_spell const *> instance; + + if (instance.empty()) + { +#define SF(tier, index, name, is_summon, is_annoy, is_damage, is_bolt, is_smart, is_innate, is_escape, is_tactic, is_haste, is_heal) \ + instance.emplace_back(new monster_spell { \ + BOOST_PP_CAT(SF_, BOOST_PP_CAT(name, _IDX)), \ + BOOST_PP_CAT(SF_, name), \ + #name, \ + is_summon, \ + is_annoy, \ + is_damage, \ + is_bolt, \ + is_smart, \ + is_innate, \ + is_escape, \ + is_tactic, \ + is_haste, \ + is_heal, \ + !is_innate, \ + }); +#include "monster_spell_flag_list.hpp" +#undef SF + }; + + return instance; +} |