public AccountController(ICarServices carServices, IRoleProvider roleProvider, ICarProvider carProvider, IImageProccessorServices imageProccessorServices)
 {
     this.carServices = carServices;
     this.roleProvider = roleProvider;
     this.carProvider = carProvider;
     this.imageProccessorServices = imageProccessorServices;
 }
예제 #2
0
 public AdminController(IAdminServices adminServices, IUserServices userServices,
                        ICarServices carServices)
 {
     this.adminServices = adminServices;
     this.userServices  = userServices;
     this.carServices   = carServices;
 }
예제 #3
0
 public CarController(ICarServices iCarServ, IStringLocalizer <CarController> localizer,
                      IStringLocalizer <SharedResources> sharedLocalizer)
 {
     _carServ         = iCarServ;
     _localizer       = localizer;
     _sharedLocalizer = sharedLocalizer;
 }
 public CarController(ICarServices carService, UserManager <ApplicationUser> userManager,
                      IMapper mapper, IUserServices userServices)
 {
     this.carServices  = carService;
     this.userManager  = userManager;
     this.mapper       = mapper;
     this.userServices = userServices;
 }
예제 #5
0
 public TeamServices(ApplicationDbContext dbContext, ICarServices carServices, IMoneyAccountServices moneyAccountServices,
                     IRallyPilotsServices rallyPilots, IRallyNavigatorsServices navigatorsServices)
 {
     this.dbContext = dbContext;
     this.car       = carServices;
     this.money     = moneyAccountServices;
     this.pilot     = rallyPilots;
     this.navigator = navigatorsServices;
 }
 public AdminCarController(UserManager <ApplicationUser> userManager, IMapper mapper,
                           IAdminServices adminServices, IUserServices userServices,
                           ICarServices carServices)
 {
     this.userManager   = userManager;
     this.mapper        = mapper;
     this.adminServices = adminServices;
     this.userServices  = userServices;
     this.carServices   = carServices;
 }
 public AdminUserController(UserManager <ApplicationUser> userManager, RoleManager <IdentityRole> roleManager,
                            IAdminServices adminServices, IUserServices userServices,
                            ICarServices carServices, IMapper mapper)
 {
     this.userManager   = userManager;
     this.roleManager   = roleManager;
     this.mapper        = mapper;
     this.adminServices = adminServices;
     this.userServices  = userServices;
     this.carServices   = carServices;
 }
예제 #8
0
 public CompetitionsController(ILogger <CompetitionsController> logger, ICarServices carServices, ICompetitionsServices competitionsServices,
                               ITeamServices teamServices, IRallyPilotsServices rallyPilots, IRallyNavigatorsServices rallyNavigators, IRunwaysServices runwaysServices)
 {
     this._logger      = logger;
     this.cars         = carServices;
     this.competitions = competitionsServices;
     this.teams        = teamServices;
     this.pilots       = rallyPilots;
     this.navigators   = rallyNavigators;
     this.runways      = runwaysServices;
 }
예제 #9
0
 public BookingCarController(IMapper mapper, IEmployeeServices employeeServices, ITicketSerivces ticketSerivces,
                             IDriverServices driverServices, ICarServices carServices, IBusinessUnitSerivces businessUnitSerivces,
                             ITripServices tripServices)
 {
     _mapper               = mapper;
     _employeeServices     = employeeServices;
     _ticketSerivces       = ticketSerivces;
     _driverServices       = driverServices;
     _carServices          = carServices;
     _businessUnitServices = businessUnitSerivces;
     _tripServices         = tripServices;
 }
예제 #10
0
 public CompetitionsServices(ApplicationDbContext dbContext, ICarServices carServices, ITeamServices teamServices,
                             IRallyPilotsServices pilotsServices, IRallyNavigatorsServices navigatorsServices, IRunwaysServices runwaysServices,
                             IRaceHistoryServices raceHistoryServices, IPeople people, IRatingListServices ratingListServices,
                             IMoneyAccountServices moneyAccountServices)
 {
     this.dbContext   = dbContext;
     this.cars        = carServices;
     this.team        = teamServices;
     this.pilots      = pilotsServices;
     this.navigators  = navigatorsServices;
     this.runways     = runwaysServices;
     this.raceHistory = raceHistoryServices;
     this.people      = people;
     this.money       = moneyAccountServices;
     this.ratingList  = ratingListServices;
 }
예제 #11
0
        public ApiMutation(IAutoMakerServices autoMakerServices, ICarServices carServices)
        {
            Name = "Mutation";

            Field <AutoMakerType>(
                "createautomaker",
                description: "Create a new Automaker",
                arguments: new QueryArguments(
                    new QueryArgument <AutoMakerInputType> {
                Name = "input"
            }
                    ),
                resolve: (context) =>
            {
                var dto = autoMakerServices.Create(context.GetArgument <AutoMakerDto>("input"));

                if (dto.Valid)
                {
                    return(dto);
                }

                throw new ExecutionError(dto.Message);
            }
                );

            Field <CarType>(
                "createcar",
                description: "Create a new Car",
                arguments: new QueryArguments(
                    new QueryArgument <CarInputType> {
                Name = "input"
            }
                    ),
                resolve: (context) =>
            {
                var dto = carServices.Create(context.GetArgument <CarDto>("input"));

                if (dto.Valid)
                {
                    return(dto);
                }

                throw new ExecutionError(dto.Message);
            }
                );
        }
예제 #12
0
 public CarsController(ICarServices carService)
 {
     _carService = carService;
 }
예제 #13
0
 public CarsController(ILogger <CarsController> logger, ICarServices carServices)
 {
     this._logger = logger;
     this.car     = carServices;
 }
예제 #14
0
 public CarsController(ICarServices service)
 {
     _service = service;
 }
예제 #15
0
        private void CompetitiveStage(IRallyPilotsServices pilots, IPeople people, IRallyNavigatorsServices navigators,
                                      ITeamServices team, IRaceHistoryServices raceHistory, ICarServices cars, List <CompetitionsTeams> teams,
                                      RallyRunway runway, int count, List <CompetitionsTeams> crashed, decimal stages, int numberStage)
        {
            string input = string.Empty;

            for (int i = 0; i < count; i++)
            {
                var pilot       = pilots.GetPilotNoTracking(teams[i].PilotId);
                var energyPilot = pilots.EnergyPilot(teams[i].PilotId) - stages * damageConstant;
                people.ReduceEnergy(pilot, energyPilot);
                var navigator       = navigators.GetNavigator(teams[i].NavigatorId);
                var energyNavigator = navigators.EnergyNavigator(teams[i].NavigatorId) - stages * damageConstant;
                people.ReduceEnergy(navigator, energyNavigator);
                var teamRace = team.FindUserAsync(teams[i].TeamId).GetAwaiter().GetResult();
                int drive;

                if (numberStage == 1)
                {
                    if (i == 0)
                    {
                        if (teams[i].Drive == DriveType.Aggressive)
                        {
                            input = $"Първи стартира отборът на {teamRace.Name}, с пилот {pilot.FirstName}, който тръгва с мръсна газ. Наблюдаваме доста агресивно" +
                                    $" каране дано, навигатор до него {navigator.FirstName} му влее малко разум.";
                            drive = 3;
                        }
                        else if (teams[i].Drive == DriveType.Normal)
                        {
                            input = $"Първи стартира отборът на {teamRace.Name}, с пилот {pilot.FirstName}" +
                                    $" и навигатор до него {navigator.FirstName} ";
                            drive = 2;
                        }
                        else
                        {
                            input = $"Първи стартира отборът на {teamRace.Name}, с пилот {pilot.FirstName}, който потегля доста плахо. С това предпазливо каране, ще " +
                                    $"изостане доста в класацията, дано навигатор до него {navigator.FirstName} му повлияе полужително.";
                            drive = 1;
                        }
                    }
                    else
                    {
                        if (teams[i].Drive == DriveType.Aggressive)
                        {
                            input = $"Следващ е отборът на {teamRace.Name}, с пилот {pilot.FirstName}, който тръгва с мръсна газ. Наблюдаваме доста агресивно" +
                                    $" каране дано, навигатор до него {navigator.FirstName} му влее малко разум.";
                            drive = 3;
                        }
                        else if (teams[i].Drive == DriveType.Normal)
                        {
                            input = $"Следващия отборът на старта е {teamRace.Name}, с пилот {pilot.FirstName}" +
                                    $" и навигатор до него {navigator.FirstName} ";
                            drive = 2;
                        }
                        else
                        {
                            input = $"Към старт линията се приближава отборът на {teamRace.Name}, с пилот {pilot.FirstName}, който потегля доста плахо. С това предпазливо каране, ще " +
                                    $"изостане доста в класацията, дано навигатор до него {navigator.FirstName} му повлияе полужително.";
                            drive = 1;
                        }
                    }
                }
                else
                {
                    if (teams[i].Drive == DriveType.Aggressive)
                    {
                        input = $"Пилот {pilot.FirstName} от отборът на {teamRace.Name}, продължава с агресивното шофиране. Не съм обеден че това ще му донесе привилегии " +
                                $" за напред. Дано, навигатор до него {navigator.FirstName} го успокой за да не станем свидетели на катастрофа.";
                        drive = 3;
                    }
                    else if (teams[i].Drive == DriveType.Normal)
                    {
                        input = $"Пилот {pilot.FirstName} от отборът на {teamRace.Name}, продължава с едно чудестно представяне.";

                        drive = 2;
                    }
                    else
                    {
                        input = $"Пилот {pilot.FirstName} от отборът на {teamRace.Name}, продължава с плахото шофиране. Очаквах повече от този пилот " +
                                $"Дано навигатор до него {navigator.FirstName} даде малко смелост да натисне педала.";
                        drive = 1;
                    }
                }

                raceHistory.AddHistory(input);

                var random = RandomEvents(pilot, navigator, runway.Difficulty, drive);
                if (random == "the end")
                {
                    input = $"Мик невнимание и пилота {pilot.FirstName} изпусна завоя, колата се преобърна в канавката. Дано всички са наред. " +
                            $"Това беше края на състезанието за отбор: {teamRace.Name}";
                    var date = new DateTime();
                    ratingList.AddInRatingList(teamRace, date);
                    crashed.Add(teams[i]);
                }
                else if (random == "Ok")
                {
                    input = $"Без проблеми отборрът на {teamRace.Name} с {pilot.FirstName} зад волана и навигатор до него {navigator.FirstName}" +
                            $"преминаха през втората контрола";
                    var turbo = cars.GetTurbo(teamRace.User);
                    if (turbo != null && teams[i].UseOfTurboType == UseOfTurboType.Medium)
                    {
                        var    speed    = (cars.GetMaxCurrentSpeed(teamRace.User) + cars.GetTurbo(teamRace.User).Speed) / 60; //to convene in km / h
                        double time     = (double)stages / (double)speed;
                        var    date     = new DateTime();
                        var    realTime = date.AddMinutes(time);
                        ratingList.AddInRatingList(teamRace, realTime);
                    }
                    else
                    {
                        var    speed    = cars.GetMaxCurrentSpeed(teamRace.User) / 60; //to convene in km / h
                        double time     = (double)stages / (double)speed;
                        var    date     = new DateTime();
                        var    realTime = date.AddMinutes(time);
                        ratingList.AddInRatingList(teamRace, realTime);
                    }
                }
                else
                {
                    input = $"Пилота {pilot.FirstName} от отбора на {teamRace.Name}, се разсея за момент и излезе от идеалната линия. Това му костваше цени секунди";
                    var turbo = cars.GetTurbo(teamRace.User);
                    if (turbo != null && teams[i].UseOfTurboType == UseOfTurboType.Medium)
                    {
                        var    speed    = (cars.GetMaxSpeed(teamRace.User) + cars.GetTurbo(teamRace.User).Speed) / 60; //to convene in km / h
                        double time     = (double)stages / (double)speed;
                        var    date     = new DateTime();
                        var    realTime = date.AddMinutes(time).AddSeconds(double.Parse(random));
                        ratingList.AddInRatingList(teamRace, realTime);
                    }
                    else
                    {
                        var    speed    = cars.GetMaxSpeed(teamRace.User) / 60; //to convene in km / h
                        double time     = (double)stages / (double)speed;
                        var    date     = new DateTime();
                        var    realTime = date.AddMinutes(time).AddSeconds(double.Parse(random));
                        ratingList.AddInRatingList(teamRace, realTime);
                    }
                }

                raceHistory.AddHistory(input);

                pilots.DecreaseEnergy(pilot.Id, 100 - (int)energyPilot);
                pilots.IncreaseExperience(pilot.Id, numberStage);            //2 comes from the number of Stage - stageTwo
                navigators.DecreaseEnergy(navigator.Id, 100 - (int)energyNavigator);
                navigators.IncreaseExperience(navigator.Id, numberStage);    //2 comes from the number of Stage - stageTwo
                cars.Damage(teamRace.CarId, numberStage, runway.Difficulty); //2 comes from the number of Stage - stageTwo
            }
        }
예제 #16
0
 public CarManager(ICarDal carDal, ICarServices carServices)
 {
     _carDal      = carDal;
     _carServices = carServices;
 }
예제 #17
0
 public CarsController(ICarServices service)
 {
     _service = service;
 }
 public CarAdminController(ICarServices carServices)
 {
     this.carServices = carServices;
 }
예제 #19
0
 public CarController(ICarServices cars)
 {
     this.cars = cars;
 }
 public CarController(ICarServices carServices, ILogger <CarController> logger)
 {
     _carServices = carServices;
     _logger      = logger;
 }
예제 #21
0
 public CarController(ICarServices car)
 {
     _carservices = car;
 }
예제 #22
0
 /// <summary>
 /// Public constructor to initialize car service instance
 /// </summary>
 public CarsController()
 {
     _carServices = new CarServices();
 }
예제 #23
0
 public CarsController(ICarServices cars, IPartsServices parts, ILogServices logs)
 {
     this.cars = cars;
     this.parts = parts;
     this.logs = logs;
 }
예제 #24
0
 public CarsController(ICarServices cars,
                       IPartService parts)
 {
     this.cars  = cars;
     this.parts = parts;
 }
예제 #25
0
 public ProfileController(IUserServices userServices, ICarServices carServices, IStatisticsServices statisticsServices)
 {
     this.userServices = userServices;
     this.carServices = carServices;
     this.statisticsServices = statisticsServices;
 }
 public CarsController(ICarServices carServices)
 {
     _carServices = carServices;
 }
예제 #27
0
 public Program(ICarServices carservices)
 {
     this.carservices = carservices;
 }
예제 #28
0
 public CarsController(ICarServices services)
 {
     this._services = services;
 }
예제 #29
0
 static void GetProxy(ICarServices proxy)
 {
     Console.WriteLine(proxy.ShowFuel());
     Console.WriteLine(proxy.ShowLocation());
 }
예제 #30
0
 public CarfunctionController(ICarServices carservice)
 {
     this.carservices = carservice;
 }
 public RepairController(IMapper mapper, ICarServices carServices,
                         IRepairServices repairServices)
 {
     this.mapper         = mapper;
     this.repairServices = repairServices;
 }
예제 #32
0
 public DriverServices(BookingCarDbContext context, ICarServices carServices) : base(context)
 {
     _carServices = carServices;
 }
예제 #33
0
 public MarketServices(ApplicationDbContext dbContext, IMoneyAccountServices moneyAccount, ICarServices car)
 {
     this.dbContext = dbContext;
     money          = moneyAccount;
     this.cars      = car;
 }