, reaaaallly, reaaaaallly want, - :
public static void Main(string[] args)
{
var area = new Tile[5, 5];
for (var j = 0; j < 5; j++)
for (var i = 0; i < 5; i++)
area[i, j] = new Tile() { height = (j + 1) * (i + 1), terrain = 99 };
linq:
var onlyHeights = Enumerable
.Range(0, 25)
.Aggregate(new int[5, 5], (acc, i) =>
{
acc[i / 5, i % 5] = area[i / 5, i % 5].height;
return acc;
});
:
for (var j = 0; j < 5; j++)
for (var i = 0; i < 5; i++)
Console.WriteLine($"area.height {area[i, j].height} => {onlyHeights[i, j]}");
Console.ReadLine();
}
:
area.height 1 => 1
area.height 2 => 2
area.height 3 => 3
area.height 4 => 4
area.height 5 => 5
area.height 2 => 2
area.height 4 => 4
area.height 6 => 6
area.height 8 => 8
area.height 10 => 10
area.height 3 => 3
area.height 6 => 6
area.height 9 => 9
area.height 12 => 12
area.height 15 => 15
area.height 4 => 4
area.height 8 => 8
area.height 12 => 12
area.height 16 => 16
area.height 20 => 20
area.height 5 => 5
area.height 10 => 10
area.height 15 => 15
area.height 20 => 20
area.height 25 => 25
for's
.