Ejemplo n.º 1
0
        public Robot BuildRobot(RobotType RobotType)
        {
            var parts = GetRobotPartsFor(RobotType);

            if (parts?.Count == 0)
            {
                return(null);
            }

            switch (RobotType)
            {
            case RobotType.RoboticDog:
                return(_robotService.BuildRobotDog(parts));

            case RobotType.RoboticCat:
                return(_robotService.BuildRobotCat(parts));

            case RobotType.RoboticDrone:
                return(_robotService.BuildRobotDrone(parts));

            case RobotType.RoboticCar:
                return(_robotService.BuildRobotCar(parts));

            default:
                return(null);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Builds a robot of a specific type.
        /// </summary>
        /// <param name="robotType"></param>
        /// <returns></returns>
        public RobotModel BuildRobot(RobotTypeEnum robotType)
        {
            switch (robotType)
            {
            case RobotTypeEnum.RoboticDog:
                return(_robotService.BuildRobotDog(GetRobotPartsFor(robotType)));

            case RobotTypeEnum.RoboticCat:
                return(_robotService.BuildRobotCat(GetRobotPartsFor(robotType)));

            case RobotTypeEnum.RobotocDrone:
                return(_robotService.BuildRobotDrone(GetRobotPartsFor(robotType)));

            default:
                return(_robotService.BuildRobotCar(GetRobotPartsFor(robotType)));
            }
        }