//after the text has been split up and placed into a 2s array we have to fill up our data arrays //after this, positions and data is passed to the WorldHandler //so that it can begin to populate the 3D scene private static void PopulateGridData(string[,] data) { int rows = data.GetLength(0); int columns = data.GetLength(1); _levelGrid = new DataSpace[rows, columns]; _objectsGrid = new System.Object[rows, columns]; _worldRef.Initialize3DArea(rows, columns); for (int i = 0; i < rows; i++) { for (int j = 0; j < columns; j++) { DataSpace newspace = null; switch (data[i, j]) { case "P": newspace = new DataSpace("O"); break; case "B": case "O": newspace = new DataSpace(data[i, j]); break; case "L": newspace = new DataSpace("O"); break; case "W": newspace = new DataSpace("X"); break; default: newspace = new DataSpace("X"); break; } _objectsGrid[i, j] = null; _levelGrid[i, j] = newspace; _worldRef.Populate3DLevel(i, j, data[i, j]); } } }