示例#1
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            timeStampCounter++;
            if (timeStampCounter == 5 && btnStatMakeSure == true)
            {
                myStats = new StatisticsForm(map.Shops, map.Warehouses, this, map);
            }
            map.NextTick(timeStampCounter);
            string holder = "";

            foreach (Location s in map.Shops)
            {
                holder += "SHOP" + s.LocationID + " stock: " + ((Shop)s.Building).Stock + " Restock: " + ((Shop)s.Building).RestockAmount + "\n";
            }
            holder += "Cell Max D: " + Cell.MaxDemand + " DG: " + Cell.MaxDemandGrow + "\n";
            foreach (Cell c in map.GetCells())
            {
                holder += "Cell (" + c.Index.Column + "," + c.Index.Row + ") D: " + c.Demand + " DG: " + c.DemandGrow + "\n";
            }
            // shortesRoutesRichTbx.Clear();
            // shortesRoutesRichTbx.Text += holder;
            if (drawHeatMap)
            {
                Map.RedrawMap();
            }
            // btnStatistics.Enabled = true;
            // myStats.Add(selectedLocations);
        }
示例#2
0
        private void btnStatistics_Click(object sender, EventArgs e)
        {
            //StatisticsForm myStats = new StatisticsForm();
            if (timeStampCounter == 20 && map.Statistics.Count() >= 1)
            {
                btnStatistics.Enabled = true;
            }

            try { myStats.Show(); }
            catch { myStats.Close(); }

            if (openOnce == true)
            {
                myStats = new StatisticsForm(map.Shops, map.Warehouses, this, map);
            }
        }