So I declare a multidimensional array of nodes like this
Node[,] nodes;
In order to store Node objects in it I have to do this
nodes = new Node[Xsize, Ysize];
but then when I go to store the actual Node objects I do this
for(int x = 0; x < Xsize; x++)
{
for(int y = 0; y < Ysize; y++)
{
nodes[x,y] = new Node()
}
}
My question is, why is step 2 of this necessary? I am already saying new Node()
when I place my individual node objects in my multidimensional array, and it already knows the array is of type Node.