I think it's time to make our 'main' function. I am going to use the linux g++ compiler over the SSH connection, because
my Windows is so slow and clunky, and the linux is fast, so I like it. Developing the Windows project as a console application, will be pretty close,
if you insist, just slower. I also like the g++ error description, it's pretty easy to figure out what they don't like. Windows is kind of cryptic.
This code will allow us to enter the data relevant to Oradea. Let's look at what is happening;
voidMakeMap( ): We don't need to return anything, because we are going to enter the data manually for this example.
CityTempCity: A temporary container so we can place our information in the 'Cities' vector.
NeighborTempNeighbor A temporary container so we can place the neighbor characteristics in the 'Neighbor' vector.
TempCity.Name="Oradea": Give the city a name.
TempNeighbor.Name="Zerind": Give Oradea's first neighbor a name.
TempNeighbor.Distance= 71: This is the distance between Oradea and Zerind from way back at Figure Agent-2.
TempNeighbor.ShortestDistance= 374: This is the straight line distance between Zerind and Bucharest, for the A* algorithm.
TempCity.Neighbors.push_back(TempNeighbor): Save the 'Zerind' data in 'Oradeas' Neighbor vector.
Now that we have copied the contents of TempNeighbor in the vector, we can reuse the variable for the next city.
Repeat the Neighbor steps for Sibiu so we can have 2 neighbors for Oradea.
Cities.push_back(TempCity): Save Oradea data in the Cities vector. ==> Cities vector now has all the data it needs for Oradea
I can see right now, entering the data for all these cities is going to be quite tedious. We can make a function, to
ease the burden a little bit, but I'm tempted to make an optical character recognition program, to scan the distances in automatically, but I guess
we'll save that for another day, and just muddle through.