Advertisement
Guest User

Untitled

a guest
Mar 4th, 2025
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.77 KB | None | 0 0
  1. namespace Eppo
  2. {
  3.     class UUID
  4.     {
  5.     public:
  6.         UUID();
  7.         UUID(uint64_t uuid);
  8.         UUID(const UUID&) = default;
  9.  
  10.         operator uint64_t() const
  11.         {
  12.             return m_UUID;
  13.         }
  14.  
  15.         operator bool() const
  16.         {
  17.             return static_cast<bool>(m_UUID);
  18.         }
  19.  
  20.     private:
  21.         uint64_t m_UUID;
  22.     };
  23.  
  24.     using AssetHandle = UUID;
  25.  
  26.     struct Asset
  27.     {
  28.         Asset() = default;
  29.         virtual ~Asset() = default;
  30.  
  31.         AssetHandle Handle;
  32.  
  33.         virtual bool operator==(const Asset& other) const
  34.         {
  35.             return Handle == other.Handle;
  36.         }
  37.  
  38.         virtual bool operator!=(const Asset& other) const
  39.         {
  40.             return !(*this == other);
  41.         }
  42.     };
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement