Exemple #1
0
        static private int GetAfterRaceBalance(Driver driver, TechnicalDirector td, StaffFacilities sf, bool testing, TyresSupplier tyre, Car car, Divisions division, int qualPosition, int racePosition, int trainning, int[] carPartsBought)
        {
            int qualifyingCost = Constants.qualCost;

            int totalCosts = driver.Salary + driver.TrainningCost((DriverTrainning)trainning) +
                             td.Salary +
                             sf.GetExpenses() +
                             (testing ? 1000000 : 0) +
                             qualifyingCost +
                             tyre.GetActiveSupplierCost() +
                             car.GetCarUpgradesCost(carPartsBought);

            int raceWinnings = SpHelper.GetRaceWinnings(division, qualPosition, racePosition);

            //int balanceAfterRace = (int)(balanceM * 1000000f - totalCosts + raceWinnings);
            int balanceAfterRace = (int)(raceWinnings - totalCosts);

            return(balanceAfterRace);
        }
Exemple #2
0
        SeasonPlannerFullLine GetInitialSpFull()
        {
            SeasonPlannerFullLine spFull = new SeasonPlannerFullLine();

            SeasonPlannerDecision[] spDecisions = DB.SeasonPlannerTab.ReadSpDecisionsFromDB(0);

            SeasonPlannerForOptimizer spOptimizer = new SeasonPlannerForOptimizer();
            RaceTab rTab = DB.RaceTab.ReadRaceTabFromDB();

            spOptimizer.raceTab = rTab;
            SeasonPlannerTab spTab = DB.SeasonPlannerTab.ReadSeasonPlannerTabFromDB();

            spOptimizer.spTab = spTab;
            StaffFacilities sf = DB.StaffFacilities.ReadStaffFacilitiesFromDB();

            spOptimizer.staffFacilities = sf;
            TechnicalDirector td = DB.TechnicalDirector.ReadTdFromDB();

            spOptimizer.technicalDirector = td;
            Driver driver = DB.Driver.ReadDriverFromDB();

            spOptimizer.driver = driver;
            Car car = DB.Car.ReadCarFromDB();

            spOptimizer.car = car;

            SeasonPlannerForDataTable spTable = new SeasonPlannerForDataTable();

            spTable.BalanceAfterRaceM = spTab.StartingBalanceM;

            spFull.spTable     = spTable;
            spFull.spOptimizer = spOptimizer;
            spFull.spTab       = spTab;
            spFull.spDecisions = spDecisions[0];

            return(spFull);
        }