Filthy newline drama?
[craw.git] / craw / d2_data.cpp
blobf00d3ffb5dd68724d318cb12ab59f59a7ee9cd07
1 #include "d2_data.hpp"
3 bool read_flag(unsigned flags, unsigned offset)
5 return ((flags >> offset) & 1) != 0;
8 bool monster_data::is_minion()
10 return get_flag(4);
13 bool monster_data::is_champion()
15 return get_flag(2);
18 bool monster_data::is_boss()
20 return get_flag(3);
23 bool monster_data::get_flag(unsigned offset)
25 return read_flag(flags, offset);
28 bool monster_statistics::is_npc()
30 //use interact flag, haha.
31 return read_flag(flags, 9);
34 std::string item_text::get_code() const
36 return std::string(code, 3);
39 std::string roster_unit::get_name()
41 std::string output;
43 for(std::size_t i = 0; i < sizeof(name); i++)
45 char letter = name[i];
46 if(letter == 0)
47 break;
48 output.push_back(letter);
51 return output;