From ad049a15b43b7ddba3fe7d0a898652fc8022629d Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Tue, 22 Apr 2014 11:46:23 -0700 Subject: Use strict ID types Possibly some missing for the far side of the network. AccountId and BlockId are still terribly entangled. --- src/map/map.t.hpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/map/map.t.hpp') diff --git a/src/map/map.t.hpp b/src/map/map.t.hpp index b6b14bb..d9e3c1f 100644 --- a/src/map/map.t.hpp +++ b/src/map/map.t.hpp @@ -21,10 +21,11 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# include "../sanity.hpp" +# include "fwd.hpp" # include "../strings/vstring.hpp" +# include "../mmo/ids.hpp" # include "../mmo/mmo.hpp" namespace e @@ -585,4 +586,10 @@ struct NpcName : VString<23> {}; struct ScriptLabel : VString<23> {}; struct ItemName : VString<23> {}; +class BlockId : public Wrapped { public: BlockId() : Wrapped() {} protected: template constexpr explicit BlockId(A... a) : Wrapped(a...) {} }; +inline +BlockId account_to_block(AccountId a) { return wrap(unwrap(a)); } +inline +AccountId block_to_account(BlockId b) { return wrap(unwrap(b)); } + #endif // TMWA_MAP_MAP_T_HPP -- cgit v1.2.3-60-g2f50