From e2682e866d27f93bdbd89ff84eb0368c690f1af0 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Mon, 30 Dec 2019 19:19:40 +0100 Subject: [PATCH] added the layer to collision infos --- MLEM.Extended/Tiled/TiledMapCollisions.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/MLEM.Extended/Tiled/TiledMapCollisions.cs b/MLEM.Extended/Tiled/TiledMapCollisions.cs index a63ce4c..3eb8065 100644 --- a/MLEM.Extended/Tiled/TiledMapCollisions.cs +++ b/MLEM.Extended/Tiled/TiledMapCollisions.cs @@ -38,7 +38,7 @@ namespace MLEM.Extended.Tiled { return; } var tilesetTile = tile.GetTilesetTile(this.map); - this.collisionInfos[layerIndex, x, y] = new TileCollisionInfo(this.map, new Vector2(x, y), tile, tilesetTile); + this.collisionInfos[layerIndex, x, y] = new TileCollisionInfo(this.map, new Vector2(x, y), tile, layer, tilesetTile); } public IEnumerable GetCollidingTiles(RectangleF area, Func included = null) { @@ -67,11 +67,13 @@ namespace MLEM.Extended.Tiled { public class TileCollisionInfo { public readonly TiledMapTile Tile; + public readonly TiledMapTileLayer Layer; public readonly TiledMapTilesetTile TilesetTile; public readonly ReadOnlyCollection Collisions; - public TileCollisionInfo(TiledMap map, Vector2 position, TiledMapTile tile, TiledMapTilesetTile tilesetTile) { + public TileCollisionInfo(TiledMap map, Vector2 position, TiledMapTile tile, TiledMapTileLayer layer, TiledMapTilesetTile tilesetTile) { this.TilesetTile = tilesetTile; + this.Layer = layer; this.Tile = tile; var collisions = new List();