public void LaunchMissile() { string type = UserInputValidator.ReadMissileTypeName("Enter missile type to launch:"); Console.WriteLine("Enter amount of missiles to launch"); int amount = UserInputValidator.ReadIntParser(); LaunchissileChecker(type, amount); }
public static int CalculateDistance(int maxDistance, string TargetMissile = "war") { Console.WriteLine($"Please enter the target`s distance for missile {TargetMissile} (1-{maxDistance}):"); int distance = UserInputValidator.ReadIntParser(); while (distance > 1500) { Console.WriteLine($"Distance cannot be above {maxDistance}km. Please try again:"); distance = UserInputValidator.ReadIntParser(); } return(distance); }
public void RemoveMissile() { ShowReport(); Console.WriteLine(); Console.WriteLine("Enter the index of the missile which you would like to remove"); int choice = UserInputValidator.ReadIntParser(); try { Missile m = Launcher.AllMissiles[choice]; RemoveMissileFromInventory(m); } catch { Console.WriteLine("No missile for this index"); } }