private static void Main() { do { Console.Clear(); #region Set data. var amount = GetNumber <int>("Enter amount of points on the plane: ", "Amount must be > 0: ", el => el > 0); var massPoints = GetMassPoints(amount); var radiusOfSet = GetNumber <double>("Enter radius of set: ", "Radius must be > 1: ", el => el > 1); var setOfMassPoints = new SetOfMassPoints(massPoints, new PointS(0, 0), radiusOfSet); #endregion PrintInfo(setOfMassPoints); PrintMessage("Press ESC for exit, press any other key ro repeat solution", ConsoleColor.Green); } while (Console.ReadKey(true).Key != ConsoleKey.Escape); }
/// <summary> /// Print info about points. /// </summary> /// <param name="setOfMassPoints"> Set of mass points </param> private static void PrintInfo(SetOfMassPoints setOfMassPoints) { Console.WriteLine(); if (setOfMassPoints.SpecialSetMassPoints.Count == 0) { PrintMessage("There are no such points\n\n"); } foreach (var massPoint in setOfMassPoints.SpecialSetMassPoints) { PrintMessage(massPoint.ToString(), ConsoleColor.Yellow); } }