Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions source/DefaultEcs/World.cs
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,11 @@ public void Dispose()
/// </summary>
public int MaxCapacity { get; }

/// <summary>
/// Gets the unique id of the world instance.
/// </summary>
public int Id => GetHashCode();

#endregion

#region Initialisation
Expand Down Expand Up @@ -799,6 +804,15 @@ public void Dispose()
/// <returns>A string representing this instance.</returns>
public override string ToString() => $"World {WorldId}";

/// <summary>
/// Returns a hashcode representing this instance.
/// </summary>
/// <returns>A hashcode representing this instance.</returns>
public override int GetHashCode()
{
return WorldId.GetHashCode();
}

#endregion
}
}