コード例 #1
0
 private void CheckUserInput(string userRocketType)
 {
     if (RocketValidation.IsRocketTypeValid(userRocketType))
     {
         RocketType rocketType = (RocketType)Enum.Parse(typeof(RocketType), userRocketType);
         _rocketFactory.AddRocket(rocketType);
     }
     else
     {
         _consoleSystem.Write($"There is no rocket with the type: {userRocketType}");
     }
 }
コード例 #2
0
        private void CheckUserInput(string userRocketType, string userRocketAmount)
        {
            if (RocketValidation.IsRocketTypeValid(userRocketType))
            {
                RocketType rocketType = (RocketType)Enum.Parse(typeof(RocketType), userRocketType);
                int        amount     = int.Parse(userRocketAmount);

                int amontRoketlaunch = _battery.LaunchFewRockets(rocketType, amount);
                _consoleSystem.Write($"the rocket amount success to launch: {amontRoketlaunch.ToString()}");
            }
            else
            {
                _consoleSystem.Write($"There is no rocket with the type: {userRocketType}");
            }
        }