Ejemplo n.º 1
0
        private static void GoToCashCounter(CollectorPictureBox collector)
        {
            var collectorView = collector.Tag as CollectorView;
            var cashCounter   = ModelingProcessor.CashCounter;

            collectorView.CashCounter = cashCounter;

            collectorView.IsGoesToCashCounter = true;

            int   destPointX;
            int   destPointY;
            Point destPoint;

            // Additional points for better graphics
            destPointX = cashCounter.Left - ElementSizeDefiner.CarWidth + 5;
            destPointY = cashCounter.Bottom + ElementSizeDefiner.TopologyCellSize - 10;
            destPoint  = new Point(destPointX, destPointY);

            collector.AddDestinationPoint(destPoint);

            destPointX = cashCounter.Left + DestinationPointsDefiner.FuelingPointDeltaX;
            destPointY = cashCounter.Bottom + DestinationPointsDefiner.FuelingPointDeltaY;
            destPoint  = new Point(destPointX, destPointY);

            // The main point of fueling
            collector.AddDestinationPoint(destPoint);

            // Additional points for better graphics
            destPointX = cashCounter.Right - ElementSizeDefiner.TopologyCellSize / 2;
            destPoint  = new Point(destPointX, destPointY + ElementSizeDefiner.CarHeight + 5);
            collector.AddDestinationPoint(destPoint);
        }
        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;
 }