internal static PictureBox CreateCashCounterPictureBox(CashCounterView cashCounterView, Point locationPoint) { var size = TopologyCellSize; PictureBox cashCounter = new PictureBox { Tag = cashCounterView, Image = Properties.Resources.cashbox, Size = new Size(size, size), Location = locationPoint, SizeMode = PictureBoxSizeMode.StretchImage }; cashCounter.MouseClick += CashCounterPictureBox_Click; _modelingForm.PlaygroundPanel.Controls.Add(cashCounter); cashCounter.BringToFront(); _mappedTopology.CashCounter = cashCounter; _mappedTopology.CashCounterDestinationPoint = new Point(cashCounter.Left + FuelingPointDeltaX, cashCounter.Bottom + FuelingPointDeltaY); return(cashCounter); }
internal static void CollectCash(CollectorPictureBox collector, CashCounterView cashCounter) { var collectorView = collector.Tag as CollectorView; collectorView.GetCashFromCashCounter(); if (cashCounter.CurrentCashVolume < 0) { StopCollectingCash(collector, cashCounter); } }
private static void StopCollectingCash(CollectorPictureBox collector, CashCounterView cashCounter) { var collectorView = collector.Tag as CollectorView; collectorView.ReturnCashToCashCounter(0 - cashCounter.CurrentCashVolume); collector.IsFilling = false; collector.IsFilled = true; //cashCounter.IsFull = false; _isCollectingMoney = false; }
internal static void StartCollectingCash(CollectorPictureBox collector, CashCounterView cashCounter) { collector.IsFilling = true; }