mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-09-15 14:52:35 +02:00
* Added centered unit box static field to Box2. * MapGrid is more testable. * Added some unit tests for MapGrid. Fixed bug in MapChunk.GridTileToLocal(). MapGrid.UpdateAABB() actually expands properly now. * Moved IMapChunk to Robust.Shared.Map. Moved Chunk class out of MapManager class. * Added unit tests for MapChunk. * Bounds reduce by 1, so almost working. * Now bound shrinking works :D * Moved MapGrid out of MapManager. Moved IMapGrid into the Shared/Map folder. Replaced all calls to IMapGrid.ParentMap.Index with IMapGrid.ParentMapId. * Added more MapGrid unit tests. Fixed a bug in TryGetTileRef.
24 lines
621 B
C#
24 lines
621 B
C#
using NUnit.Framework;
|
|
using Robust.Shared.Maths;
|
|
|
|
namespace Robust.UnitTesting.Shared.Maths
|
|
{
|
|
[TestFixture, Parallelizable, TestOf(typeof(Box2i))]
|
|
class Box2i_Test
|
|
{
|
|
[Test]
|
|
public void Box2iUnion()
|
|
{
|
|
var boxOne = new Box2i(-1, -1, 1, 1);
|
|
var boxTwo = new Box2i(0, 0, 2, 2);
|
|
|
|
var result = boxOne.Union(boxTwo);
|
|
|
|
Assert.That(result.Left, Is.EqualTo(-1));
|
|
Assert.That(result.Bottom, Is.EqualTo(-1));
|
|
Assert.That(result.Right, Is.EqualTo(2));
|
|
Assert.That(result.Top, Is.EqualTo(2));
|
|
}
|
|
}
|
|
}
|