I want to use Linq to query a 2D array but I get an error:
Could not find an implementation of the query pattern for source type \'SimpleGame.ILandsca
Your map is a multidimensional array--these do not support LINQ query operations (see more Why do C# Multidimensional arrays not implement IEnumerable
You'll need to either flatten the storage for your array (probably the best way to go for many reasons) or write some custom enumeration code for it:
public IEnumerable Flatten(T[,] map) {
for (int row = 0; row < map.GetLength(0); row++) {
for (int col = 0; col < map.GetLength(1); col++) {
yield return map[row,col];
}
}
}