You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Could I have an in-memory data structure that stores which grid cells are occupied and by which tile? Resizing a tile would store which tile occupies which cells, so that could work.
#257
Open
DrewNaylor opened this issue
Sep 6, 2023
· 0 comments
And so on. occupiedBy will be used to look up the tile in a specific spot if necessary, or simply calculate the tile's size if possible as that will be an easier way to see if another tile will fit nearby. If coordinates are not recorded in the data structure, then it's assumed that cell is empty but the tile will still need to be sure it can fit.
I'm not going to use the YAML layout file for this because I need to be able to update this in memory and I can't store too much in memory as that would be bloated.
When pinning, unpinning, and resizing, we will consult this data structure to see where the new tile should go, whether tiles can shift up (if all tiles in a row are unpinned; don't shift tiles around when unpinning if a row is not empty as that's not what WP did I think), and whether tiles need to be pushed to the next row or if they can be pushed to another column, respectively. This will also be used when loading tiles to ensure they don't overlap each other, which should only be a problem when converting the previous tile layout file to the new one with columns and rows.
The text was updated successfully, but these errors were encountered:
So it'll be like (this is JSON):
And so on.
occupiedBy
will be used to look up the tile in a specific spot if necessary, or simply calculate the tile's size if possible as that will be an easier way to see if another tile will fit nearby. If coordinates are not recorded in the data structure, then it's assumed that cell is empty but the tile will still need to be sure it can fit.I'm not going to use the YAML layout file for this because I need to be able to update this in memory and I can't store too much in memory as that would be bloated.
When pinning, unpinning, and resizing, we will consult this data structure to see where the new tile should go, whether tiles can shift up (if all tiles in a row are unpinned; don't shift tiles around when unpinning if a row is not empty as that's not what WP did I think), and whether tiles need to be pushed to the next row or if they can be pushed to another column, respectively. This will also be used when loading tiles to ensure they don't overlap each other, which should only be a problem when converting the previous tile layout file to the new one with columns and rows.
The text was updated successfully, but these errors were encountered: