public static void AddCollisionFrom(this TileShapeCollection tileShapeCollection, Scene scene, Dictionary <string, TileMapInfo> tileMapInfos) { var stringEnum = tileMapInfos.Values.Where(item => item.HasCollision).Select(item => item.Name); tileShapeCollection.AddCollisionFrom(scene, stringEnum); }
public static void AddCollisionFrom(this TileShapeCollection tileShapeCollection, LayeredTileMap layeredTileMap, IEnumerable <TileMapInfo> tileMapInfos) { var stringEnum = tileMapInfos.Where(item => item.HasCollision).Select(item => item.Name); tileShapeCollection.AddCollisionFrom(layeredTileMap, stringEnum); }
public static void AddCollisionFrom(this TileShapeCollection tileShapeCollection, LayeredTileMap layeredTileMap) { var tilesWithCollision = layeredTileMap.TileProperties .Where(item => item.Value.Any(property => property.Name == "HasCollision" && (string)property.Value == "True")) .Select(item => item.Key).ToList(); tileShapeCollection.AddCollisionFrom(layeredTileMap, tilesWithCollision); }
public static void AddCollisionFromTilesWithType(this TileShapeCollection tileShapeCollection, LayeredTileMap layeredTileMap, string type) { tileShapeCollection.AddCollisionFrom( layeredTileMap, (list) => list.Any(item => item.Name == "Type" && (item.Value as string) == type)); }
public static void AddCollisionFromTilesWithProperty(this TileShapeCollection tileShapeCollection, LayeredTileMap layeredTileMap, string propertyName) { tileShapeCollection.AddCollisionFrom( layeredTileMap, (list) => list.Any(item => item.Name == propertyName)); }