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
I want to store multiple images (with different attributes) per tile-type and find the correct json object that matches a key.
like:
Type floor, orientation: center
for (auto it : TileDataJSON["floor"].items()) {
cout << "key " << it.key() << " and val " <<it.value();
}
Output:
key 0 and val {"image":"floor_0.png","orientation":"flat"}
key 1 and val {"image":"floor_center.png","orientation":"center"}
key 2 and val {"image":"floor_n.png","orientation":"n"}
....
Which makes sense.
If i try to access TileDataJSON["floor"][it.key()]
i get an exception. ( i think it's because it.key is a string an not an int...
My (simplified) JSON File looks like this:
"floor": [
{
"image": "floor_0.png",
"orientation": "flat"
},
{
"image": "floor_center.png",
"orientation": "center"
}
]
}```
What is the correct way to find the correct object of a type by an attribute?
The text was updated successfully, but these errors were encountered:
I want to store multiple images (with different attributes) per tile-type and find the correct json object that matches a key.
like:
Type floor, orientation: center
Output:
Which makes sense.
If i try to access
TileDataJSON["floor"][it.key()]
i get an exception. ( i think it's because it.key is a string an not an int...
My (simplified) JSON File looks like this:
The text was updated successfully, but these errors were encountered: