Hi!
I have a question regarding the above mentioned method of the EntityManager.
I want to display a 2-dimensional grid, where one cell is represented by an Entity “Cell” which should contain some data about it.
The size of the grid should be fixed but still I do not want (and probably anyway should not) manually create every cell – So using the entityManager for this seemed obvious. However I want quick and easy access to my cell objects via their position – which would work if I would use the “list” – e.g.
cellList[x * dimensionX + y]….
I could do it like in the documentation:
Item {
cellList: [
Cell{…},
Cell{…}
]
}
But again, this would mean manual work. I than came up with the idea to create each cell with the entityManager.createEntityFromUrl(), get it out with getLastAddedEntitity(), setup the needed data and than add it to my list.
However I see 2 problems:
- If the getLastAddedEntitiy() returns a copy (which is no where stated) I would needlessly blow up my data needs
- “list” anyways seems to be kinda static (documentation states objects cannot added or removed)
So I would like to know if 1) is true and what possible alternatives I have for 2).
Thx in advance!