Add MapCoordinates.Nullspace.

This commit is contained in:
Pieter-Jan Briers
2020-01-20 22:26:04 +01:00
parent dd98f3cbad
commit 103fca8bc7
2 changed files with 7 additions and 5 deletions

View File

@@ -99,9 +99,9 @@ namespace Robust.Shared.Map
{
return new GridCoordinates(Position + offset, GridID);
}
/// <summary>
/// Checks that these coordinates are within a certain distance of another set.
/// Checks that these coordinates are within a certain distance of another set.
/// </summary>
/// <param name="mapManager">Map manager containing the two GridIds.</param>
/// <param name="otherCoords">Other set of coordinates to use.</param>
@@ -118,7 +118,7 @@ namespace Robust.Shared.Map
}
/// <summary>
/// Checks that these coordinates are within a certain distance of another set.
/// Checks that these coordinates are within a certain distance of another set.
/// </summary>
/// <param name="mapManager">Map manager containing the two GridIds.</param>
/// <param name="otherCoords">Other set of coordinates to use.</param>
@@ -288,6 +288,8 @@ namespace Robust.Shared.Map
[Serializable, NetSerializable]
public readonly struct MapCoordinates : IEquatable<MapCoordinates>
{
public static readonly MapCoordinates Nullspace = new MapCoordinates(Vector2.Zero, MapId.Nullspace);
/// <summary>
/// World Position coordinates.
/// </summary>

View File

@@ -80,7 +80,7 @@ namespace Robust.UnitTesting.Shared.Map
mapMan.CreateNewMapEntity(MapId.Nullspace);
var oldEntity = (Entity)entMan.CreateEntityUninitialized(null, new MapCoordinates(Vector2.Zero, MapId.Nullspace));
var oldEntity = (Entity)entMan.CreateEntityUninitialized(null, MapCoordinates.Nullspace);
oldEntity.InitializeComponents();
mapMan.Restart();
@@ -131,7 +131,7 @@ namespace Robust.UnitTesting.Shared.Map
mapMan.CreateNewMapEntity(MapId.Nullspace);
// Act
var newEntity = entMan.SpawnEntityAt(null, new MapCoordinates(Vector2.Zero, MapId.Nullspace));
var newEntity = entMan.SpawnEntityAt(null, MapCoordinates.Nullspace);
// Assert
Assert.That(newEntity.Transform.MapID, Is.EqualTo(MapId.Nullspace));