示例#1
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)));
            }
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="ToggleMachineLicenseParameters" /> class.
 /// </summary>
 /// <param name="Key">Key.</param>
 /// <param name="RobotType">RobotType (required).</param>
 /// <param name="Enabled">Enabled (required).</param>
 public ToggleMachineLicenseParameters(string Key = default(string), RobotTypeEnum RobotType = default(RobotTypeEnum), bool?Enabled = default(bool?))
 {
     // to ensure "RobotType" is required (not null)
     if (RobotType == null)
     {
         throw new InvalidDataException("RobotType is a required property for ToggleMachineLicenseParameters and cannot be null");
     }
     else
     {
         this.RobotType = RobotType;
     }
     // to ensure "Enabled" is required (not null)
     if (Enabled == null)
     {
         throw new InvalidDataException("Enabled is a required property for ToggleMachineLicenseParameters and cannot be null");
     }
     else
     {
         this.Enabled = Enabled;
     }
     this.Key = Key;
 }
示例#3
0
 private List <PartModel> GetRobotPartsFor(RobotTypeEnum robotType)
 {
     return(_partsService.GetParts(robotType).ToList());
 }