diff options
Diffstat (limited to 'src/mmo/ids.hpp')
-rw-r--r-- | src/mmo/ids.hpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/mmo/ids.hpp b/src/mmo/ids.hpp index 3c5b1ba..ed5ab58 100644 --- a/src/mmo/ids.hpp +++ b/src/mmo/ids.hpp @@ -21,6 +21,7 @@ # include "fwd.hpp" +# include "../ints/little.hpp" # include "../ints/wrap.hpp" # include "extract.hpp" @@ -33,6 +34,8 @@ class CharId : public Wrapped<uint32_t> { public: CharId() : Wrapped<uint32_t>() class PartyId : public Wrapped<uint32_t> { public: PartyId() : Wrapped<uint32_t>() {} protected: constexpr explicit PartyId(uint32_t a) : Wrapped<uint32_t>(a) {} }; class ItemNameId : public Wrapped<uint16_t> { public: ItemNameId() : Wrapped<uint16_t>() {} protected: constexpr explicit ItemNameId(uint16_t a) : Wrapped<uint16_t>(a) {} }; +class BlockId : public Wrapped<uint32_t> { public: BlockId() : Wrapped<uint32_t>() {} protected: constexpr explicit BlockId(uint32_t a) : Wrapped<uint32_t>(a) {} }; + class GmLevel { uint32_t bits; @@ -98,6 +101,30 @@ public: { return l.bits != r.bits; } + + friend + bool native_to_network(Byte *network, GmLevel native) + { + network->value = native.bits; + return true; // LIES. But this code is going away soon anyway + } + friend + bool network_to_native(GmLevel *native, Byte network) + { + native->bits = network.value; + return true; // LIES. But this code is going away soon anyway + } + + friend + bool native_to_network(Little32 *network, GmLevel native) + { + return native_to_network(network, native.bits); + } + friend + bool network_to_native(GmLevel *native, Little32 network) + { + return network_to_native(&native->bits, network); + } }; inline |