Exemple #1
0
        public Dictionary <Region, Dictionary <Region, float> > InitDijkstraVertices()
        {
            var res = new Dictionary <Region, Dictionary <Region, float> >();

            Cartographer cartographer = new Cartographer();

            var regions = cartographer.regions;

            foreach (Region reg in regions)
            {
                var neighbours     = cartographer.GetNeighboursUnrouted(reg.Index);
                var neighboursDict = new Dictionary <Region, float>();
                foreach (var n in neighbours)
                {
                    neighboursDict.Add(n, cartographer.GetMovementPrice(n, reg.Index));
                    res[reg] = neighboursDict;
                }
            }
            return(res);
        }