diff --git a/GlitchyEngine/src/Content/AssetHandle.bf b/GlitchyEngine/src/Content/AssetHandle.bf index e96a66d..810074c 100644 --- a/GlitchyEngine/src/Content/AssetHandle.bf +++ b/GlitchyEngine/src/Content/AssetHandle.bf @@ -24,7 +24,7 @@ struct AssetHandle : IHashable /// Create a new random AssetHandle public this() { - _uuid = UUID(); + _uuid = UUID.Create(); } private this(UUID uuid) diff --git a/GlitchyEngine/src/Core/UUID.bf b/GlitchyEngine/src/Core/UUID.bf index 9ceb479..b681d53 100644 --- a/GlitchyEngine/src/Core/UUID.bf +++ b/GlitchyEngine/src/Core/UUID.bf @@ -19,17 +19,17 @@ namespace GlitchyEngine.Core ((.)new => Serialize, (.)new => Deserialize)); } - /// Creates a new random UUID. - public this() - { - _uuid = s_Random.NextU64(); - } - /// Creates a new UUID with the given value. public this(uint64 uuid) { _uuid = uuid; } + + /// Creates a new random UUID. + public static UUID Create() + { + return UUID(s_Random.NextU64()); + } public int GetHashCode() { diff --git a/GlitchyEngine/src/World/Components/Components.bf b/GlitchyEngine/src/World/Components/Components.bf index 2fe7cf4..142e8e2 100644 --- a/GlitchyEngine/src/World/Components/Components.bf +++ b/GlitchyEngine/src/World/Components/Components.bf @@ -27,7 +27,7 @@ namespace GlitchyEngine.World /// Create a new IDComponent with a random UUID. public this() { - ID = UUID(); + ID = UUID.Create(); } public this(UUID id)