Example #1
0
        //--------------------------------------------------------------------

        private void RealizeObserveProgram()
        {
            Pocket -= SoldCars.getInstance().TechObsserveCost;

            DataCollecter.getInstance().deboostIncome(SoldCars.getInstance().TechObsserveCost);

            PocketLbl.Text = Pocket.ToString() + " $";
        }
        public static DataCollecter getInstance()
        {
            if (instance == null)
            {
                instance = new DataCollecter();
            }

            return(instance);
        }
Example #3
0
        private void ApproveBtn_Click(object sender, EventArgs e)
        {
            Filial.getInstance().CarsInGarage += trackBar1.Value;

            CarsLbl.Text = Filial.getInstance().CarsInGarage.ToString();

            Pocket -= trackBar1.Value * Filial.getInstance().CarPrice;

            DataCollecter.getInstance().deboostIncome(trackBar1.Value * Filial.getInstance().CarPrice);

            PocketLbl.Text = Pocket.ToString() + " $";

            choserStateChanger(false);

            trackBar1.Value = 0;
        }
Example #4
0
        public static float DayActivity()
        {
            Random rnd = new Random();

            var filialsCount = Filial.getInstance().Filials.Count();

            int CarsBought = (rnd.Next() % 3) * filialsCount;

            float SoldGoodsIncome = (250 + rnd.Next() % 250) * filialsCount;

            float TechObservIncomes = ((2 - rnd.Next() % 2) * SoldCars.getInstance().TechObsserveCost) * filialsCount;

            float MoneyToChange = 0;

            int limit = CarsBought;


            if (CarsBought > Filial.getInstance().CarsInGarage)
            {
                limit = Filial.getInstance().CarsInGarage;
            }
            for (int i = 0; i < limit; i++)
            {
                SoldCars.getInstance().AddCarToObserveProgramm();
            }

            foreach (var filial in Filial.getInstance().Filials)
            {
                filial.DaysBeforeSalary--;
                if (filial.DaysBeforeSalary == 0)
                {
                    MoneyToChange          -= filial.SalaryFund;
                    filial.DaysBeforeSalary = 30;
                }
            }

            MoneyToChange += limit * (Filial.getInstance().CarPrice + 5000) + SoldGoodsIncome + TechObservIncomes;

            DataCollecter.getInstance().boostIncome(MoneyToChange);

            Filial.getInstance().CarsInGarage -= limit;

            SoldCars.getInstance().CheckForObserveDate();

            return(MoneyToChange);
        }
Example #5
0
 public void Draw()
 {
     if (DataCollecter.getInstance().MonthCounter <= 1)
     {
         panel1.Visible    = false;
         NoInfoLbl.Visible = true;
     }
     else
     {
         panel1.Visible      = true;
         NoInfoLbl.Visible   = false;
         IncomeLbl.Text      = DataCollecter.getInstance().IncomeOfPreviousMonth.ToString();
         SoldCarsLbl.Text    = SoldCars.getInstance().TotalSoldCars.ToString();
         CarsInTOLbl.Text    = SoldCars.getInstance().soldCars.Count().ToString();
         IncomeBoostlbl.Text = DataCollecter.getInstance().SellingBoostUp.ToString();
         StuffRewardLbl.Text = DataCollecter.getInstance().Reward.ToString();
     }
 }
Example #6
0
        //filials buy/sell buttons
        private void BuyFillialBtn_Click(object sender, EventArgs e)
        {
            if (Pocket > Filial.getInstance().FilialPrice)
            {
                Filial.getInstance().addFilial();

                FilialsLbl.Text = (Int32.Parse(FilialsLbl.Text) + 1).ToString();

                Pocket -= Filial.getInstance().FilialPrice;

                DataCollecter.getInstance().deboostIncome(Filial.getInstance().FilialPrice);

                PocketLbl.Text = Pocket.ToString() + " $";

                NotEnoughMoneyLbl.Visible = false;
            }
            else
            {
                NotEnoughMoneyLbl.Visible = true;
            }
        }
Example #7
0
 public static float MonthActivity()
 {
     DataCollecter.getInstance().deboostIncome(Filial.getInstance().CarsInGarage * 200);
     DataCollecter.getInstance().MonthController();
     return(-Filial.getInstance().CarsInGarage * 200);
 }