Esempio n. 1
0
        public async Task ShowMyQuest(QuestAction questAction)
        {
            var result = await DoCommand(async() => {
                var playerId = _account.PlayerId;

                var command = new ShowMyQuestCommand(playerId, questAction.Type);
                await _bus.SendCommand(command);
            });
        }
Esempio n. 2
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);
        }