Example #1
0
        public int OnExecute()
        {
            try {
                saveFilePath  = CommandHelpers.GetSaveFile(CommandHelpers.GetSaveFolder());
                newCabinCount = Prompt.GetInt("How many player slots would you like to add? ", 1);
                var game = new SaveGame(saveFilePath);
                while (newCabinCount > 0)
                {
                    var cabins = game.Cabins;
                    // Default to Log Cabin. Doesn't matter, AddPlayer is deprecated.
                    game.CreateNewCabin(1);
                    newCabinCount--;
                }

                CommandHelpers.SaveFile(game);
                Console.Write("Done!");
                Console.ReadLine();
                return(CommandHelpers.Success);
            }
            catch (Exception ex) {
                Console.Error.WriteLine(ex.Message);
                Console.Error.WriteLine(ex.StackTrace);
                return(CommandHelpers.Failure);
            }
        }