diff options
author | Ben Longbons <b.r.longbons@gmail.com> | 2014-10-25 15:24:26 -0700 |
---|---|---|
committer | Ben Longbons <b.r.longbons@gmail.com> | 2014-10-26 14:21:48 -0700 |
commit | 86395f53634b3ef1ce76a7f1e5edfdb61f8ffd80 (patch) | |
tree | 2710c62fe71d5e0d2e228fba9c951a040c4dcddf /src/mmo/strs.hpp | |
parent | 6800761863dd45b6055768febc6ace6a20120dc7 (diff) | |
download | tmwa-86395f53634b3ef1ce76a7f1e5edfdb61f8ffd80.tar.gz tmwa-86395f53634b3ef1ce76a7f1e5edfdb61f8ffd80.tar.bz2 tmwa-86395f53634b3ef1ce76a7f1e5edfdb61f8ffd80.tar.xz tmwa-86395f53634b3ef1ce76a7f1e5edfdb61f8ffd80.zip |
Fix header ranking
Diffstat (limited to 'src/mmo/strs.hpp')
-rw-r--r-- | src/mmo/strs.hpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/mmo/strs.hpp b/src/mmo/strs.hpp index fea0c98..6a132c2 100644 --- a/src/mmo/strs.hpp +++ b/src/mmo/strs.hpp @@ -123,4 +123,37 @@ CharName stringish<CharName>(VString<23> iv) { return CharName(iv); } + +struct MobName : VString<23> {}; +struct NpcName : VString<23> {}; +struct ScriptLabel : VString<23> {}; +struct ItemName : VString<23> {}; + +// formerly VString<49>, as name::label +struct NpcEvent +{ + NpcName npc; + ScriptLabel label; + + explicit operator bool() + { + return npc || label; + } + bool operator !() + { + return !bool(*this); + } + + friend bool operator == (const NpcEvent& l, const NpcEvent& r) + { + return l.npc == r.npc && l.label == r.label; + } + + friend bool operator < (const NpcEvent& l, const NpcEvent& r) + { + return l.npc < r.npc || (l.npc == r.npc && l.label < r.label); + } + + friend VString<49> convert_for_printf(NpcEvent ev); +}; } // namespace tmwa |