Files
RobustToolbox/Robust.Shared/Map/MapId.cs
T
SilverandGitHub 25926a17b7 Renames SS14.* to Robust.* (#793)
RobustToolbox projects should be named Robust.* 

This PR changes the RobustToolbox projects from SS14.* to Robust.*

Updates SS14.* prefixes/namespaces to Robust.*
Updates SpaceStation14.sln to RobustToolbox.sln
Updates MSBUILD/SS14.* to MSBUILD/Robust.*
Updates CSProject and MSBuild references for the above
Updates git_helper.py
Removes Runserver and Runclient as they are unusable
2019-04-15 20:24:59 -06:00

58 lines
1.2 KiB
C#

using System;
using Robust.Shared.Serialization;
namespace Robust.Shared.Map
{
[Serializable, NetSerializable]
public struct MapId : IEquatable<MapId>
{
public static readonly MapId Nullspace = new MapId(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();
}
}
}