mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
Add MapCoordinates.Nullspace.
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user