create_network

Function create_network 

Source
pub fn create_network() -> HashMap<City, HashMap<City, u8>>
Expand description

This function creates the game network. This is a Hash map of which the keys are the cities of the game and the value of each key is a Hash map of the cities that the key city can connect with and the number of trains that are needed to connect to that city.

destination HashMap is used to fill it in with all the relevant destinations of a city each time, and when it is cloned in the network HashMap as the value of the key, it is cleared and reused for the next city’s destinations.