Пример #1
0
        public string HandleInput(ConsoleKeyInfo input)
        {
            int number = ConsoleKeyParser.GetIntFromKey(input);

            if (number >= 1 && number <= _availableQuests.Count)
            {
                _data.Player.Quests.Add(_availableQuests[number - 1]);
                _availableQuests.RemoveAt(number - 1);
            }

            if (input.Key == ConsoleKey.C)
            {
                List <Quest> completed = GameStorage.Get().Player.Quests.Where(q => q.IsFinished).ToList();
                if (completed.Count > 0)
                {
                    foreach (Quest q in completed)
                    {
                        GameStorage.Get().Player.TurnInQuest(q);
                    }
                }
                else
                {
                    return("No Completed Quests!");
                }
            }
            return("");
        }
Пример #2
0
        public string HandleInput(ConsoleKeyInfo input)
        {
            if (_selectedQuest != null && input.Key == ConsoleKey.X)
            {
                _selectedQuest = null;
            }


            int selection = ConsoleKeyParser.GetIntFromKey(input);

            if (selection >= 1 && selection <= _quests.Count)
            {
                _selectedQuest = _quests[selection - 1];
            }

            return("");
        }