当前位置: 首页>>代码示例>>C#>>正文


C# Conversation.SetName方法代码示例

本文整理汇总了C#中Conversation.SetName方法的典型用法代码示例。如果您正苦于以下问题:C# Conversation.SetName方法的具体用法?C# Conversation.SetName怎么用?C# Conversation.SetName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Conversation的用法示例。


在下文中一共展示了Conversation.SetName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Conversation1

        public static IConversation Conversation1()
        {
            //Create dialogs
            IDialog dialog1 = new Dialog("Hello. What is your name");
            IDialog dialog2 = new Dialog("Hello. My name is \"EndlessDialogs\"");
            IDialog dialog3 = new Dialog("What are you you?");
            IDialog dialog4 = new Dialog("I am a software library that help developers to make conversation system.");
            IDialog dialog5 = new Dialog("Got you.");

            //Create dialog connections. In this case it is linear conversation
            dialog1.AddNext(new[] { dialog2 });
            dialog2.AddNext(new[] { dialog3 });
            dialog3.AddNext(new[] { dialog4 });
            dialog4.AddNext(new[] { dialog5 });

            //Create a conversation
            IConversation conversation1 = new Conversation();
            conversation1.SetName("Conversation 1");
            conversation1.SetDescription("Demo: Scene1 - Conversation1 ('DemoSceneCreator.cs' - 'CreateScene1()')");
            conversation1.SetStartDialog(new[] { dialog1 });

            return conversation1;
        }
开发者ID:AntonyBaasan,项目名称:endlessdialogs,代码行数:23,代码来源:DemoSceneCreator.cs

示例2: Conversation2Branched

        public static IConversation Conversation2Branched()
        {
            //Create dialogs
            IDialog dialog1 = new Dialog("Hello. What is your name?");
            IDialog dialogAnwer1 = new Dialog("My name is Player1");
            IDialog dialogAnwer2 = new Dialog("My name is Player2");
            IDialog dialogAnwer3 = new Dialog("My name is Player3");

            IDialog dialog2 = new Dialog("Nice to meet you Player1");
            IDialog dialog3 = new Dialog("Nice to meet you Player2");
            IDialog dialog4 = new Dialog("Nice to meet you Player3");

            IDialog dialog5 = new Dialog("Bye!.");
            IDialog dialog6 = new Dialog("Fare well ???.");

            //Create dialog connections. In this case it is linear conversation
            dialog1.AddNext(new[] { dialogAnwer1, dialogAnwer2, dialogAnwer3 });

            dialogAnwer1.AddNext(new[] { dialog2 });
            dialogAnwer2.AddNext(new[] { dialog3 });
            dialogAnwer3.AddNext(new[] { dialog4 });

            dialog2.AddNext(new[] { dialog5 });
            dialog3.AddNext(new[] { dialog5 });
            dialog4.AddNext(new[] { dialog5 });

            dialog5.AddNext(new[] { dialog6 });

            //Create a conversation
            IConversation conversation1 = new Conversation();
            conversation1.SetName("Conversation 2 (Branched)");
            conversation1.SetDescription("Demo: Scene1 - Conversation2 ('DemoSceneCreator.cs' - 'CreateScene2()')");
            conversation1.SetStartDialog(new[] { dialog1 });

            return conversation1;
        }
开发者ID:AntonyBaasan,项目名称:endlessdialogs,代码行数:36,代码来源:DemoSceneCreator.cs


注:本文中的Conversation.SetName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。