Example #1
0
        internal void CalculateTopCityDestination()
        {
            var towndistances = new List <TownDistance>(distancetoalltowns.Values.Where(x => x.town.mapData.Villiage.CurrentEconPull != 0));

            choice1 = towndistances.Aggregate((a, b) => a.town.mapData.Villiage.CurrentEconPull / Math.Sqrt(a.Distance) > b.town.mapData.Villiage.CurrentEconPull / Math.Sqrt(b.Distance) ? a : b);
            towndistances.Remove(choice1);
            choice2 = towndistances.Aggregate((a, b) => a.town.mapData.Villiage.CurrentEconPull / Math.Sqrt(a.Distance) > b.town.mapData.Villiage.CurrentEconPull / Math.Sqrt(b.Distance) ? a : b);
            towndistances.Remove(choice2);
            choice3 = towndistances.Aggregate((a, b) => a.town.mapData.Villiage.CurrentEconPull / Math.Sqrt(a.Distance) > b.town.mapData.Villiage.CurrentEconPull / Math.Sqrt(b.Distance) ? a : b);
            towndistances.Remove(choice3);
        }
Example #2
0
        internal void CalculateTopDestinations(int v)
        {
            var towndistances = new List <TownDistance>(distancetoalltowns.Values);

            choice1 = towndistances.Aggregate((a, b) => a.town.mapData.BaseEconPull / Math.Sqrt(a.Distance) > b.town.mapData.BaseEconPull / Math.Sqrt(b.Distance) ? a : b);
            towndistances.Remove(choice1);
            choice2 = towndistances.Aggregate((a, b) => a.town.mapData.BaseEconPull / Math.Sqrt(a.Distance) > b.town.mapData.BaseEconPull / Math.Sqrt(b.Distance) ? a : b);
            towndistances.Remove(choice2);
            choice3 = towndistances.Aggregate((a, b) => a.town.mapData.BaseEconPull / Math.Sqrt(a.Distance) > b.town.mapData.BaseEconPull / Math.Sqrt(b.Distance) ? a : b);
            towndistances.Remove(choice3);
        }