Files
RobustToolbox/Robust.Shared/Map/MapId.cs
Acruid e16732eb7b Network View Bubble (#1629)
* Adds barbones culling.

* Visibility culling and recursive parent ent additions.
DebugEntityNetView improvements.
Visibility moved from session to eyecomponent.

* Multiple viewport support.

* Perf improvements.

* Removed old netbubble system from ServerEntityManager.
Supports old NaN system for entities leaving view.
Supports old SendFullMap optimization for anchored, non-updating Entities.

* Fixes size of netView box.

* Remove empty EntityManager.Update method.
Switching ViewCulling back to PLINQ.
2021-03-29 16:17:34 -07:00

58 lines
1.2 KiB
C#

using System;
using Robust.Shared.Serialization;
namespace Robust.Shared.Map
{
[Serializable, NetSerializable]
public readonly struct MapId : IEquatable<MapId>
{
public static readonly MapId Nullspace = new(0);
internal readonly int Value;
public MapId(int value)
{
Value = value;
}
/// <inheritdoc />
public bool Equals(MapId other)
{
return Value == other.Value;
}
/// <inheritdoc />
public override bool Equals(object? obj)
{
if (ReferenceEquals(null, obj)) return false;
return obj is MapId id && Equals(id);
}
/// <inheritdoc />
public override int GetHashCode()
{
return Value;
}
public static bool operator ==(MapId a, MapId b)
{
return a.Value == b.Value;
}
public static bool operator !=(MapId a, MapId b)
{
return !(a == b);
}
public static explicit operator int(MapId self)
{
return self.Value;
}
public override string ToString()
{
return Value.ToString();
}
}
}