protected void ShowCompleteQuest(QuestLog questLog) { if (questLog.StartedQuests.Length == 0) { Console.WriteLine("No quests have been started."); Console.WriteLine(); return; } bool exit = false; while (!exit) { ListQuests(questLog); Console.WriteLine(); Console.WriteLine("Complete a Quest"); Console.WriteLine("Type 'done' when finished completing quests."); int questId = GetIntInput("Enter a questId> ", "done"); if (questId > 0) { if (!questLog.HasCompleted(questId)) { if (questLog.HasStarted(questId)) { questLog.CompleteQuest(questId); Console.WriteLine("Quest {0} has been completed.", questId); } else { Console.WriteLine("Quest has not been started."); } } else { Console.WriteLine("Quest has already been completed."); } } else if (questId == -1) { exit = true; } else { Console.WriteLine("Invalid quest Id."); } } Console.WriteLine(); }
protected void ShowAbandonQuest(QuestLog questLog) { bool exit = false; while (!exit) { if (questLog.StartedQuests.Length == 0) { Console.WriteLine("No quests have been started."); Console.WriteLine(); return; } ListQuests(questLog); Console.WriteLine(); Console.WriteLine("Adbandon a Quest"); Console.WriteLine("Type 'done' when finished abandoning quests."); int questId = GetIntInput("Enter a questId> ", "done"); if (questId > 0) { if (questLog.HasStarted(questId)) { questLog.AbandonQuest(questId); Console.WriteLine("Quest {0} has been abandoned.", questId); } else { Console.WriteLine("Quest has not been started."); } } else if (questId == -1) { exit = true; } else { Console.WriteLine("Invalid quest Id."); } } Console.WriteLine(); }
protected void ShowStartQuest(QuestLog questLog) { bool exit = false; while (!exit) { Console.WriteLine("Start a Quest"); Console.WriteLine("Type 'done' when finished starting quests."); int questId = GetIntInput("Enter a questId> ", "done"); if (questId > 0) { if (!questLog.HasStarted(questId)) { if (!questLog.HasCompleted(questId)) { questLog.StartQuest(questId); Console.WriteLine("Quest {0} has been started.", questId); } else { Console.WriteLine("Quest has already been completed."); } } else { Console.WriteLine("Quest has already been started."); } } else if (questId == -1) { exit = true; } else { Console.WriteLine("Invalid quest Id."); } Console.WriteLine(); } }