so for my A* algorithm I want to create a settings file that contains the data information for the loops creating the grid.
Currently my cells just need to know their field cost but this might change later on. I want to keep the information flexible.
A simple way would be creating a byte array
but I can only store the field cost in there. I thought about taking JSON for this
{
"1": [ // my first row
{
"x": 1, // cell one in row one
"cost": 1
},
{
"x": 2,
"cost": null
},
{
"x": 3,
"cost": 3
},
{
"x": 4,
"cost": null
},
{
"x": 5,
"cost": 2
}
],
"2": [ // my second row
{
"x": 1, // cell one in row two
"cost": 3
},
{
"x": 2,
"cost": 2
},
{
"x": 3,
"cost": null
},
{
"x": 4,
"cost": 1
},
{
"x": 5,
"cost": 2
}
]
}
By using JSON I can store more data to cells but this structure seems to be way more complex than a simple byte array.
Are there any better solutions for this?