public void GoToNextConversation()
    {
        CurrentConversation.Reset();
        if (currentConversationNumber >= conversationList.Count)
        {
            throw new IndexOutOfRangeException("There is no conversation left, although you are trying to make one.");
            //There are no conversations left
        }
        //if the conversation is finished, start up the next event

        if (prevPlaying)    //conversation came from playingstate
        {
            GameEnvironment.GameStateManager.SwitchTo("playingState");
        }

        else if (!prevPlaying)     //conversation came from a cutsceneState
        {
            CurrentConversation.Reset();
            //load next cutscene for next time it starts.
            (GameEnvironment.GameStateManager.GetGameState("cutscene") as CutsceneState).GoToNextCutscene();

            //depending on which cutscene just completed, switch to the next cutscene or the next playingstate
            switch (currentConversationNumber)
            {
            //after the ThroneRoom2 scene, the players play the game
            case (int)Conversationnames.ThroneRoom2: GameEnvironment.GameStateManager.SwitchTo("playingState");
                break;

            default: GameEnvironment.GameStateManager.SwitchTo("cutscene");
                break;
            }
        }
        currentConversationNumber++;
    }
        public ActionResult GoToProposal([FromBody] CurrentConversation proposalParametersNavigation)
        {
            CurrentConversation  currentConversation = proposalParametersNavigation;
            ConversationDocument conversation        = Manager.GetConversationByConversationId(currentConversation.Id);
            string UrlString = Url.Action("Proposal", "Marketplace", new { idAudienceChannel = conversation.AudienceChannelId });

            return(Json(new { url = UrlString }, JsonRequestBehavior.AllowGet));
        }
        public ActionResult AddMessage([FromBody] CurrentConversation proposalParametersNavigation)
        {
            proposalParametersNavigation.MessageWithoutHtml = proposalParametersNavigation.Message;
            proposalParametersNavigation.Message            = Manager.MakeRefIfContainLink(proposalParametersNavigation.Message);
            string serviceBusTopicName = "conversationtopicdev"; // obtenerlo del web.config
            string profileName         = string.Empty;
            PublisherProfileDocument  publisherProfile  = new PublisherProfileDocument();
            AdvertiserProfileDocument advertiserProfile = new AdvertiserProfileDocument();

            List <string> usersIdInConversation = Manager.GetUsersIdInConversation(proposalParametersNavigation.Id);
            var           email = System.Web.HttpContext.Current.User.Identity.Name;

            KindAds.Utils.Enums.Roles rol;
            rol = (User.IsInRole(KindAds.Utils.Enums.Roles.Publisher.ToString()) ? KindAds.Utils.Enums.Roles.Publisher : KindAds.Utils.Enums.Roles.Advertiser);
            int rolId = Convert.ToInt32(rol);

            if (rolId == 1)
            {
                publisherProfile = Manager.GetPublisherProfile(email);
                profileName      = publisherProfile.Name;
            }
            else
            {
                advertiserProfile = Manager.GetAdvertiserProfile(email);
                profileName       = advertiserProfile.Title;
            }

            proposalParametersNavigation.ProfileName = profileName;
            ConversationMessageNotification message = new ConversationMessageNotification()
            {
                currentConversation = proposalParametersNavigation,
                users = usersIdInConversation
            };

            Manager.AddMessageToCosmos(message);
            notificationManager = new NotificationManager(serviceBusTopicName);
            notificationManager.ProcessConversationNotification(message);
            notificationManager.Close();

            return(Json(new { Result = "Send message OK" }, JsonRequestBehavior.AllowGet));
        }
 public void Reset()
 {
     CurrentConversation.Reset();
 }
 public void HandleInput(InputHelper inputHelper)
 {
     CurrentConversation.HandleInput(inputHelper);
 }
 public void Draw(GameTime gameTime, SpriteBatch spriteBatch)
 {
     drawOverState.Draw(gameTime, spriteBatch);
     CurrentConversation.Draw(gameTime, spriteBatch);
 }
 public void Update(GameTime gameTime)
 {
     CurrentConversation.Update(gameTime);
 }