Esempio n. 1
0
        public async Task <Unit> Handle(ShowMyQuestCommand command, CancellationToken cancellationToken)
        {
            var playerId = command.PlayerId;
            var type     = command.Type;


            var playerQuests = await _playerQuestDomainService.GetPlayerQuests(playerId);

            var ids = playerQuests.Where(x => x.Status == QuestStateEnum.已领取进行中).Select(x => x.QuestId).ToList();

            var questQuery = await _questDomainService.GetAll();

            var quests = questQuery.Where(x => x.Type == type && ids.Contains(x.Id));

            var myQuest = new MyQuest
            {
                Quests = _mapper.Map <List <QuestModel> >(quests),
                Type   = type
            };

            await _mudProvider.ShowQuests(playerId, myQuest);

            return(Unit.Value);
        }