public class Object2D { public int X; public int Y; public int Item; public Object2D(int x, int y, int item) { X = x; Y = y; Item = item; } }
foreach (string Line in Lines) { Line2 = Line.Split(",".ToArray()); foreach (string TIL in Line2) { Map[x2,y2] = new Object2D(x2, y2, int.Parse(TIL)); y2++; } x2++; y2 = 0; } return Map;
foreach (Object2D Texture in Map) { int x = Texture.X; int y = Texture.Y; int item = Texture.Item; }
int[,] map = new int[10, 20]; for (int x = 0; x < map.GetLength(1); x++) { for (int y = 0; y < map.GetLength(0); y++) { // A toi de jouer... } }
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionint[][] map = new int[n][];