コード例 #1
0
        public Conversation BuildConversation(IConversable forWhom)
        {
            if (playerOnlyMessage != null && !(forWhom is IPlayer))
            {
                return(new Conversation(plugin, forWhom, new NotPlayerMessagePrompt()));
            }

            Dictionary <object, object> copiedInitialSessionData = new Dictionary <object, object>();

            foreach (var initData in initialSessionData)
            {
                copiedInitialSessionData.Add(initData.Key, initData.Value);
            }

            Conversation conversation = new Conversation(plugin, forWhom, firstPrompt, copiedInitialSessionData);

            conversation.IsModal            = isModal;
            conversation.IsLocalEchoEnabled = localEchoEnabled;
            conversation.Prefix             = prefix;

            foreach (IConversationCanceller canceller in cancellers)
            {
                conversation.AddConversationCanceller((IConversationCanceller)canceller.Clone());
            }

            return(conversation);
        }
コード例 #2
0
    /// <summary>
    /// Starts the conversation.
    /// </summary>
    public void StartConversation()
    {
        // Reference to the class that contains defitions for functions triggered by this conversation
        // In effect, this is the part of the NPCs behaviour.
        IConversable npcRef = this.gameObject.GetComponentInParent(typeof(IConversable)) as IConversable;

        DialogManager.Instance.StartConversation(this.Graph, npcRef);
    }
コード例 #3
0
ファイル: Conversation.cs プロジェクト: Mitch528/BukkitNET
 public Conversation(IPlugin plugin, IConversable forWhom, IPrompt firstPrompt, Dictionary <Object, Object> initialSessionData)
 {
     this.firstPrompt      = firstPrompt;
     this.context          = new ConversationContext(plugin, forWhom, initialSessionData);
     this.modal            = true;
     this.localEchoEnabled = true;
     this.prefix           = new NullConversationPrefix();
     this.cancellers       = new List <IConversationCanceller>();
 }
コード例 #4
0
 /// <summary>
 /// Starts the conversation.
 /// </summary>
 /// <param name="Conversation">The dialog graph that will be interpreted.</param>
 /// <param name="NPC">Reference to the NPC that the player is going to talk with.</param>
 public void StartConversation(List <DialogNode> Conversation, IConversable NPC)
 {
     this.Speaker     = NPC;
     this.DialogGraph = Conversation;
     UpdateDialog(this.DialogGraph[0]);
     currentSelection  = 0;
     endOfConversation = false;
     isWindowHidden    = false;
     DialogBackground.SetActive(true);
 }
コード例 #5
0
 public ConversationContext(IPlugin plugin, IConversable forWhom, Dictionary <object, object> initialSessionData)
 {
     this.plugin      = plugin;
     this.forWhom     = forWhom;
     this.sessionData = initialSessionData;
 }
コード例 #6
0
ファイル: CommandPlugin.cs プロジェクト: strager/Ondit
 protected abstract void MessageReceived(IConversable sender, string message);
コード例 #7
0
ファイル: Conversation.cs プロジェクト: Mitch528/BukkitNET
 public Conversation(IPlugin plugin, IConversable forWhom, IPrompt firstPrompt)
     : this(plugin, forWhom, firstPrompt, new Dictionary <object, object>())
 {
 }
コード例 #8
0
ファイル: ClientHelpers.cs プロジェクト: strager/Ondit
 public static void SendNotice(this ClientBase client, IConversable receiver, string message)
 {
     client.SendMessage(new RawMessage("NOTICE", receiver.Target, message));
 }
コード例 #9
0
ファイル: ClientEvents.cs プロジェクト: strager/Ondit
 public ConversationMessageEventArgs(IConversable sender, string message)
 {
     Sender = sender;
     Message = message;
 }