fixing UUID issue

This commit is contained in:
2025-05-19 21:37:19 +02:00
parent d8350db6bf
commit 84e5e437d0
9 changed files with 84 additions and 24 deletions

View File

@@ -17,6 +17,7 @@ namespace Scop
public:
Actor();
Actor(Model model);
Actor(std::uint64_t uuid, Model model);
inline void AttachScript(std::shared_ptr<ActorScript> script) { p_script = script; }
@@ -32,7 +33,7 @@ namespace Scop
[[nodiscard]] inline const Quatf& GetOrientation() const noexcept { return m_orientation; }
[[nodiscard]] inline const Model& GetModel() const noexcept { return m_model; }
[[nodiscard]] inline Model& GetModelRef() noexcept { return m_model; }
[[nodiscard]] inline std::uint32_t GetUUID() const noexcept { return m_uuid; }
[[nodiscard]] inline std::uint64_t GetUUID() const noexcept { return m_uuid; }
[[nodiscard]] inline bool IsVisible() const noexcept { return m_is_visible; }
~Actor();
@@ -52,4 +53,16 @@ namespace Scop
};
}
namespace std
{
template <>
struct hash<Scop::Actor>
{
std::size_t operator()(const Scop::Actor& a) const noexcept
{
return static_cast<std::size_t>(a.GetUUID());
}
};
}
#endif