Replace MapIndices with Vector2i (#2228)
* Replace MapIndices with Vector2i * Update da submodule * AA EE II OO U U Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
This commit is contained in:
@@ -37,13 +37,13 @@ namespace Content.IntegrationTests.Tests
|
||||
var mapGrid = mapManager.CreateGrid(mapId);
|
||||
var mapGridEnt = entityManager.GetEntity(mapGrid.GridEntityId);
|
||||
mapGridEnt.Transform.WorldPosition = new Vector2(10, 10);
|
||||
mapGrid.SetTile(new MapIndices(0,0), new Tile(1, 512));
|
||||
mapGrid.SetTile(new Vector2i(0,0), new Tile(1, 512));
|
||||
}
|
||||
{
|
||||
var mapGrid = mapManager.CreateGrid(mapId);
|
||||
var mapGridEnt = entityManager.GetEntity(mapGrid.GridEntityId);
|
||||
mapGridEnt.Transform.WorldPosition = new Vector2(-8, -8);
|
||||
mapGrid.SetTile(new MapIndices(0, 0), new Tile(2, 511));
|
||||
mapGrid.SetTile(new Vector2i(0, 0), new Tile(2, 511));
|
||||
}
|
||||
|
||||
mapLoader.SaveMap(mapId, mapPath);
|
||||
@@ -63,14 +63,14 @@ namespace Content.IntegrationTests.Tests
|
||||
Assert.Fail();
|
||||
|
||||
Assert.That(mapGrid.WorldPosition, Is.EqualTo(new Vector2(10, 10)));
|
||||
Assert.That(mapGrid.GetTileRef(new MapIndices(0, 0)).Tile, Is.EqualTo(new Tile(1, 512)));
|
||||
Assert.That(mapGrid.GetTileRef(new Vector2i(0, 0)).Tile, Is.EqualTo(new Tile(1, 512)));
|
||||
}
|
||||
{
|
||||
if (!mapManager.TryFindGridAt(new MapId(10), new Vector2(-8, -8), out var mapGrid))
|
||||
Assert.Fail();
|
||||
|
||||
Assert.That(mapGrid.WorldPosition, Is.EqualTo(new Vector2(-8, -8)));
|
||||
Assert.That(mapGrid.GetTileRef(new MapIndices(0, 0)).Tile, Is.EqualTo(new Tile(2, 511)));
|
||||
Assert.That(mapGrid.GetTileRef(new Vector2i(0, 0)).Tile, Is.EqualTo(new Tile(2, 511)));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user