mirror of
https://github.com/AlexMacocian/MonoGame.Extended.git
synced 2026-07-24 03:56:31 +00:00
17 lines
506 B
C#
17 lines
506 B
C#
using System.Linq;
|
|
using MonoGame.Extended.Maps.Tiled;
|
|
|
|
namespace MonoGame.Extended.Collisions
|
|
{
|
|
public static class CollisionWorldExtensions
|
|
{
|
|
public static CollisionGrid CreateGrid(this CollisionWorld world, TiledTileLayer tileLayer)
|
|
{
|
|
var data = tileLayer.Tiles
|
|
.Select(t => t.Id)
|
|
.ToArray();
|
|
|
|
return world.CreateGrid(data, tileLayer.Width, tileLayer.Height, tileLayer.TileWidth, tileLayer.TileHeight);
|
|
}
|
|
}
|
|
} |