UUID: Removed empty constructor, added static Create-Function

This commit is contained in:
Simon Lübeß
2023-09-13 13:14:54 +02:00
parent 370eaf9bc7
commit ff54eb738e
3 changed files with 8 additions and 8 deletions
+1 -1
View File
@@ -24,7 +24,7 @@ struct AssetHandle : IHashable
/// Create a new random AssetHandle /// Create a new random AssetHandle
public this() public this()
{ {
_uuid = UUID(); _uuid = UUID.Create();
} }
private this(UUID uuid) private this(UUID uuid)
+6 -6
View File
@@ -19,17 +19,17 @@ namespace GlitchyEngine.Core
((.)new => Serialize, (.)new => Deserialize)); ((.)new => Serialize, (.)new => Deserialize));
} }
/// Creates a new random UUID.
public this()
{
_uuid = s_Random.NextU64();
}
/// Creates a new UUID with the given value. /// Creates a new UUID with the given value.
public this(uint64 uuid) public this(uint64 uuid)
{ {
_uuid = uuid; _uuid = uuid;
} }
/// Creates a new random UUID.
public static UUID Create()
{
return UUID(s_Random.NextU64());
}
public int GetHashCode() public int GetHashCode()
{ {
@@ -27,7 +27,7 @@ namespace GlitchyEngine.World
/// Create a new IDComponent with a random UUID. /// Create a new IDComponent with a random UUID.
public this() public this()
{ {
ID = UUID(); ID = UUID.Create();
} }
public this(UUID id) public this(UUID id)