I developed a c# library which used across 3 project that relay in that specific piece of code, though, I still need to use that code in a javascript, so im porting it out, the thing is, I don't think I can replicate the same logic, for example, I've been thinking about this for a few days I couldn't get to the answer.
In the C# library I have a 3D array which is kinda like the core property in the application, and I cannot seem to figure out how to make that work in JS environment.
For example I have this piece of code:
public Obj[,,] objs = new Obj[18, 14, 8];
In which I would allocate objects in EVERY single position, and trying to port that to javascript, seemingly would result in:
var 3dArr = new Array();
3dArr[0] = new Array();
3dArr[0][0] = new Array();
Wouldnt this always hold the array object in the first position and if I set whatever else I would lose the whole array? Or am I wrong
public Obj[ Obj[ Obj[] ] ] objs, or you create an adapter with an API that takes n-dimensional positions and maps them to one-dimensional keys/indices on an internal data-structure. likekey = [x,y,z].join('::')orindex = (x*14+y)*8+z. Sure +validation, that the position ain't out of bounds.