Exemplo n.º 1
0
        public async Task <HasActionsLeft> ActivateOpportunityCard(CardAction card)
        {
            if (card.eventId == null)
            {
                throw new Exception("card has no eventId set");
            }
            if (_cachedOpportunity == null || _cachedOpportunity.isInAStorylet)
            {
                await _session.GoBack();
            }

            Log.Info($"doing card {card.name} action {card.action}");
            _cachedList = await _session.BeginStorylet(card.eventId.Value);

            if (!string.IsNullOrWhiteSpace(card.action))
            {
                return(await PerformActions(card.action.Split(',')));
            }
            else
            {
                _cachedList.LogMessages();
            }

            return(HasActionsLeft.Consumed);
        }
Exemplo n.º 2
0
        public async Task <StoryletList> ChooseBranch(long id)
        {
            if (TestModeEnabled)
            {
                TestPostedBranches.Add(id);
                return(null);
            }
            else
            {
                StoryletList ev = await Post <StoryletList>("storylet/choosebranch", new { branchId = id, secondChanceIds = new int[0] });

                ev.LogMessages();
                return(ev);
            }
        }