コード例 #1
0
 public void GenerateAutos()
 {
     time            = _timeinterval * 50 * Pricing.WishBuyFuel();
     timer           = new Timer(time * Pricing.Coefficient);
     timer.Elapsed  += CreateAuto;
     timer.AutoReset = true;
     timer.Enabled   = true;
 }
コード例 #2
0
        private void CreateAuto(object o, EventArgs e)
        {
            timer.Interval = time * WorldTime.Coefficient() * Pricing.Coefficient * Pricing.WishBuyFuel();
            auto           = new Auto();
            SetImageOnAuto(auto);
            _refillwindow.Animation(150, 0, TimeSpan.FromSeconds(0.3), auto.ImageLink);
            Timer waittimer = new Timer(300 * Pricing.Coefficient + 20);

            waittimer.AutoReset = false;
            waittimer.Elapsed  += AboutTurningOnRefill;
            waittimer.Enabled   = true;
            CheckReadyProperty();
        }
コード例 #3
0
        public void ProvideFuel(int fuelAmount, Auto currAuto)
        {
            _refillwindow.SetFuel(Number, fuelAmount.ToString(), (fuelAmount * (Pricing.Price(currAuto.FuelType) + Pricing.ValueOfMargin(currAuto.FuelType))).ToString());
            auto            = currAuto;
            auto.FuelTank  += fuelAmount;
            Pricing.Profit += fuelAmount * Pricing.ValueOfMargin(auto.FuelType);
            Pricing.AddFuelInStat(fuelAmount, auto.FuelType);
            Timer ServiceTimer = new Timer(fuelAmount * 500 * Pricing.Coefficient + 20);

            ServiceTimer.AutoReset = false;
            ServiceTimer.Elapsed  += EndingProvideFuel;
            ServiceTimer.Enabled   = true;
            _refillwindow.DrawProgressBar(Number, TimeSpan.FromSeconds(fuelAmount * 0.5 * Pricing.Coefficient));
            //_refillwindow.Rotation(TimeSpan.FromSeconds(fuelAmount * 0.5),currAuto.ImageLink);
        }
コード例 #4
0
        public RefillWindow(int numberdispensers, int maximumautosinqueue, int marginpercentage, int timeinterval, int timeacelerate, double _92, double _95, double _98, double _DT, string day, int hours, int minutes, string testingtime)
        {
            InitializeComponent();
            int NumDispensers   = numberdispensers;
            int MaxAutosAnQueue = maximumautosinqueue;
            int MargPercentage  = marginpercentage;
            int TimeIntervl     = timeinterval;
            int TimeAccelerate  = timeacelerate;

            Pricing.SetPrice(_92, _95, _98, _DT);
            WorldTime.SetTime(day, hours, minutes);
            RefillCore RC = new RefillCore(NumDispensers, MaxAutosAnQueue, MargPercentage, TimeIntervl, this, TimeAccelerate, testingtime);

            DrawDispensers(numberdispensers);
        }