More read/write test cases for monsters, especially monster abilities
Fixes: - For radiate abilities, the pattern was not saved and defaulted to single instead of square on load - For summon abilities, what to summon was not saved and chance was incorrectly saved
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include <boost/ptr_container/ptr_set.hpp>
|
||||
#include "simpletypes.hpp"
|
||||
#include "spell.hpp"
|
||||
|
||||
std::string oboeVersionString() {
|
||||
unsigned short M, m, f;
|
||||
@@ -646,3 +647,20 @@ std::istream& operator>> (std::istream& in, eContentRating& rating) {
|
||||
in.setstate(std::ios::failbit);
|
||||
return in;
|
||||
}
|
||||
|
||||
// MARK: eSpellPat
|
||||
|
||||
cEnumLookup spell_pat_strs = {
|
||||
"single", "square", "small-square", "open-square", "radius-2", "radius-3", "plus", "wall",
|
||||
};
|
||||
|
||||
std::ostream& operator<< (std::ostream& out, eSpellPat pat) {
|
||||
writeEnum(out, pat, spell_pat_strs, "single");
|
||||
return out;
|
||||
}
|
||||
|
||||
std::istream& operator>> (std::istream& in, eSpellPat& pat) {
|
||||
if(!readEnum(in, pat, spell_pat_strs, PAT_SINGLE))
|
||||
in.setstate(std::ios::failbit);
|
||||
return in;
|
||||
}
|
||||
|
||||
@@ -170,4 +170,7 @@ std::istream& operator >> (std::istream& in, eMonstTime& e);
|
||||
std::ostream& operator<< (std::ostream& out, eAttitude node);
|
||||
std::istream& operator>> (std::istream& in, eAttitude& node);
|
||||
std::ostream& operator<<(std::ostream& out, const cMonster::cAttack& att);
|
||||
std::ostream& operator<< (std::ostream& out, eSpellPat pat);
|
||||
std::istream& operator>> (std::istream& in, eSpellPat& pat);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user