Example #1
0
        public static void CreateAPlanet(string fileName)
        {
            Console.Clear();
            Console.WriteLine("It should be here... but it isn't.\n");
            var fileContents = ReadDocument.ReadFileforList(fileName);

            WriteDocument.WriteSWPlanets(fileName, fileContents);
            Confirmations.Return();
        }
Example #2
0
        public static void AlterSWPlanets(string fileName, List <SWPlanets> sw)
        {
            ListPlanets(sw); // calls the list sw planets to display names and numbers of planets.
            var selectionEditParse        = SelectSWPlanetsEdit(sw);
            var storedNameforConfirmation = sw[selectionEditParse].Name;;

            if (Confirmations.Confirm()) //calls the confirmation method to check to see if user confirms.
            {
                ReWriteSWPlanets(fileName, sw, selectionEditParse);
                WriteDocument.WriteSWPlanets(fileName, sw); //Calls the WriteSWPlanet Method to add back the selected planets with the new info.
            }
            else
            {
                Console.Clear();
                MainMenu.DisplayMainMenu();
            }
            Console.Clear();
            Console.WriteLine($"{storedNameforConfirmation} has been edited.");
            MainMenu.DisplayMainMenu();
        }