Example #1
0
 public SettingsPageModel()
 {
     _robotService   = FreshIOC.Container.Resolve <IRobotService>();
     _barmanService  = FreshIOC.Container.Resolve <IBarmanService>();
     _agvService     = FreshIOC.Container.Resolve <IAgvService>();
     _isRobotInRelax = true;
 }
 public DownloadCardSWDestinyDBController(IRequestService requestService, IStatusService statusService,
                                          IRobotService robotService, ISiteService siteService,
                                          IDownloadCardSWDestinyDBExecutor executor) : base(requestService, statusService,
                                                                                            robotService, siteService, executor)
 {
     _robotService = robotService;
     _siteService  = siteService;
 }
Example #3
0
 public CrawlerBaseController(IRequestService requestService,
                              IStatusService statusService, IRobotService robotService,
                              ISiteService siteService, ICrawlerBaseExecutor executor)
 {
     _requestService = requestService;
     _statusService  = statusService;
     _robotService   = robotService;
     _siteService    = siteService;
     _executor       = executor;
 }
Example #4
0
 public RobotController(
     IRobotService robotService,
     IBackgroundJobClient client,
     IUserService userService,
     IMapper mapper) : base(mapper)
 {
     _robotService = robotService;
     _userService  = userService;
     _client       = client;
 }
Example #5
0
        public BarmanService()
        {
            _robotService      = FreshIOC.Container.Resolve <IRobotService>();
            _databaseService   = FreshIOC.Container.Resolve <IJsonDatabaseService>();
            _bottleTokenSource = new CancellationTokenSource();
            _agvTokenSource    = new CancellationTokenSource();

            Speed          = 60;
            SelectedBottle = new DrinksPageItem
            {
                DrinkPosition = DrinkPosition.First
            };

            BaseCupPosition = _databaseService.GetBaseCupPosition();
        }
        public RobotQueries(IRobotService robotService)
        {
            FieldAsync <ListRobotsQueryModelType>(
                SEARCH_REQUEST_ENDPOINT,
                "Returns a paginated list of Robots",
                new QueryArguments(
                    new QueryArgument <NonNullGraphType <PagedRequestType> > {
                Name = PAGINATION_ARGUMENT_NAME, Description = PagedRequestType.Description
            },
                    new QueryArgument <NonNullGraphType <OrderedRequestType> > {
                Name = ORDERING_ARGUMENT_NAME, Description = OrderedRequestType.Description
            },
                    new QueryArgument <NonNullGraphType <FilteredRequestType <Robot> > > {
                Name = FILTERING_ARGUMENT_NAME, Description = FilteredRequestType <Robot> .Description
            }
                    ),
                async context =>
            {
                var pagination = context.GetArgument <Pagination>(PAGINATION_ARGUMENT_NAME);
                var ordering   = context.GetArgument <Ordering>(ORDERING_ARGUMENT_NAME);
                var filtering  = context.GetArgument <RobotFilter>(FILTERING_ARGUMENT_NAME);

                var(totalCount, items) = await robotService.SearchRobotAsync(pagination, ordering, filtering);
                try
                {
                    return(new ListResponse <Robot>
                    {
                        TotalCount = totalCount,
                        Items = items
                    });
                }
                catch (Exception)
                {
                    context.Errors.Add(new ExecutionError("Server Error"));
                    return(null);
                }
            }
                );
        }
Example #7
0
        /// <summary>
        /// Reads the command input from a user and decides which action to take
        /// </summary>
        /// <param name="boardName"></param>
        /// <param name="robotService"></param>
        /// <returns></returns>
        private static Action ReadCommand(string boardName, IRobotService robotService)
        {
            var command = Console.ReadLine().ToLower();

            switch (command)
            {
            case string comm when comm.Contains("place"):
                var commandVariables = command.Substring(6, command.Length - 6);

                var variables = commandVariables.Split(',');
                if (variables.Length != 3)
                {
                    break;
                }

                var xSuccess = int.TryParse(variables[0], out var x);
                var ySuccess = int.TryParse(variables[1], out var y);
                var fSuccess = Enum.TryParse <Direction>(variables[2].ToUpper(), out var direction);

                if (!xSuccess || !ySuccess || !fSuccess)
                {
                    break;
                }
                return(() => robotService.PlaceRobot(boardName, new Vector2(x, y), direction));

            case "move":
                return(() => robotService.MoveForward(boardName));

            case "left":
                return(() => robotService.Rotate(boardName, RotateDirection.LEFT));

            case "right":
                return(() => robotService.Rotate(boardName, RotateDirection.RIGHT));

            case "report":
                return(() => { Console.WriteLine(robotService.ReportPosition(boardName)); });
            }
            return(() => Console.WriteLine("Invalid input please try again"));
        }
Example #8
0
 public DataInitializer(IRobotService robotService)
 {
     _robotService = robotService;
 }
Example #9
0
 public WarService(IRobotService robotService)
 {
     _robotService = robotService;
 }
Example #10
0
 public BindRobotHandler(IRobotService robotService)
 {
     _robotService = robotService;
 }
 public RobotController(IRobotService robotService)
 {
     this.robotService = robotService;
 }
Example #12
0
        /* It's always good practice to code against the interface. It allows us to test our code properly because we can mock the interfaces.
         * I am proposing that we use Dependency Injection pattern. As already mentioned above, our code will be more testable. We also going to achieve a more readability
         * along side that, our code can also be reusable
         * With Dependency Injection, we don't have to instatiate the services on the constructors, the IoC takes car of that. we can pass everything as interface.
         *
         * I would also have a factory pattern to get the Parts for either Robot or Car. This would help us clean this class a little bit more because we'd remove the last two
         * methods GetRobotPartsFor and only use the service to get the parts
         */

        public Factory(IRobotService robotService, IPartsService partsService, ICarService carService)
        {
            _robotService = robotService;
            _partsService = partsService;
            _carService   = carService;
        }
 public RobotController(IRobotService robotService, IMapper mapper)
 {
     _robotService = robotService;
     _mapper       = mapper;
 }
Example #14
0
 public RobotController(HelpersManager helperManager, IRobotService robotService, IHubContext <NotificationHub> notificationHub)
 {
     _helpersManager  = helperManager;
     _robotService    = robotService;
     _notificationHub = notificationHub;
 }
 public RefreshRobotCacheFilter(HelpersManager helpersManager, IRobotService robotService)
 {
     _helpersManager = helpersManager;
     _robotService   = robotService;
 }
Example #16
0
 public RobotsController(IRobotService service, ILogger <RobotsController> logger)
 {
     _service = service;
     _logger  = logger;
 }
Example #17
0
 public BattleService(IRobotService robotService, ICyborgService cyborgService)
 {
     _robotService    = robotService;
     _cyborgService   = cyborgService;
     _randomGenerator = new Random();
 }
Example #18
0
 public void SetupTests()
 {
     _mockCache = new Mock <ICacheService>();
     _mockCache.Setup(x => x.Get <Robot>(It.IsAny <string>())).Returns(new Robot());
     _robotService = new RobotService(_mockCache.Object);
 }
Example #19
0
 public RobotController(IMapper mapper, IRobotService robotService)
 {
     _mapper       = mapper;
     _robotService = robotService;
 }
Example #20
0
 public DriveHandler(IRobotService robotService)
 {
     _robotService = robotService;
 }
Example #21
0
 public HomeController(IRobotService robotService)
 {
     _robotService = robotService;
 }
 public BrowseAvailableRobotsHandler(IRobotService robotService)
 {
     _robotService = robotService;
 }
 public RobotsUpdateRequestProcess(IRobotService robotService, ILogger <RobotsUpdateRequestProcess> logger)
 {
     m_robotService = robotService;
     m_logger       = logger;
 }
Example #24
0
 public AdminsController(IAdminService adminService, IRobotService robotService)
 {
     this.adminService = adminService;
     this.robotService = robotService;
 }
Example #25
0
 public SearchController(IRobotService robotService, IChoreService choreService)
 {
     _choreService = choreService;
     _robotService = robotService;
 }
Example #26
0
    // remove these enums here, they should be implemented in their respective classes 'Robot' and 'Car'. Having a single responsibility class and being referenced to as a library, having it's own extension methods.

    /*enum RobotType
     * {
     *  RoboticDog,
     *  RoboticCat,
     *  RoboticDrone,
     *  RoboticCar
     * }
     *
     * enum CarType
     * {
     *  Toyota,
     *  Ford,
     *  Opel,
     *  Honda
     * }*/

    // Factory constructor is missing the ICarServiceo
    public Factory(IRobotService robotService, ICarService carService)
    {
        // Don't instantiate new instances, use dependency inversion principle, depend on abstraction, not concreation.
        _robotService = robotService;
        _carService   = carService;
    }
Example #27
0
 public RobotController(IRobotService robotService) => _robotService = robotService;
Example #28
0
 public BindManyRobotsHandler(IRobotService robotService)
 {
     _robotService = robotService;
 }
Example #29
0
 public RobotsController(IRobotService robotService)
 {
     _robotService = robotService;
 }
Example #30
0
        private static Robot Robot(IRobotService robotService, Plateau plateau)
        {
            var robot = robotService.GetRobot(plateau);

            return(robot);
        }
Example #31
0
 public Application(IRobotService robotService, IOutputWriter outputWriter)
 {
     _robotService = robotService;
     _outputWriter = outputWriter;
 }