问题
How would I go about and merge a few multidimentional arrays to one large one, using C#?
How things are set up right now i eventually get one large 2d-array that holds a a few other 2d-arrays, and I need a good way to piece the arrays together.
To explain a bit better i have one array: Object[,] largeArray
and each Object hold another array: Grid[,] smallArray
And I want to create a large grid from the content in the smallArrays, keeping the position they had in the largeArray. So the grid at largeArray[0, 1] would be placed right above largeArray[0, 0] and so on.
Clarification: If the largeArray is:
[[A, B],
[C, D]]
where A is:
[[a, a],
[a, a]]
(And so on) the result I want should then look like this:
[[a, a, b, b],
[a, a, b, b],
[c, c, d, d],
[c, c, d, d]]
The resulting Grid[,] will have the exact same size as all the small ones combined. I know that i could loop through every single element and add them individually, but is there a better way? Seeing as they already are aligned correctly in the smaller grids.
Thanks for any feedback!
来源:https://stackoverflow.com/questions/26952165/merging-multi-dimentional-arrays