Exemple #1
0
        public Map(PopulationSegment[,] mapSegments, long populationSize)
        {
            _size = new Size(((Array)mapSegments).GetLength(0),((Array)mapSegments).GetLength(1));
            Regions = new Region[(int)_size.Width, (int)_size.Height];
            long lostPop = populationSize;

            for (int w = 0; w < _size.Width; w++)
                for (int h = 0; h < _size.Height; h++)
                {
                    var r = new Region(new Location(w, h), Initializer.GetImplementation<IHistoryManager<Region>>());
                    Regions[w, h] = r;
                    r.Settle(new Population(populationSize,mapSegments[w,h]));
                    lostPop -= r.PopulationSize;

                    if ((w + 1) * (h + 1) == _size.Square)
                        if (lostPop != 0)
                            r.Settle(lostPop);

                    r.SetBizSquare();
                }
        }
 private Item CalculateNeeds(Region region, string itemId, IEnumerable<ItemConsumptionRateRow> consumtionRates, Item item, GlobalItemsStatisticTableRow itemsStat)
 {
     return null;
 }