mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
* 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.
58 lines
1.2 KiB
C#
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();
|
|
}
|
|
}
|
|
}
|