本文整理汇总了C#中IScene.GetConversations方法的典型用法代码示例。如果您正苦于以下问题:C# IScene.GetConversations方法的具体用法?C# IScene.GetConversations怎么用?C# IScene.GetConversations使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IScene
的用法示例。
在下文中一共展示了IScene.GetConversations方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PlayScene1
public static void PlayScene1(IScene scene, string fileName, string webaddress, ISceneSerializer sceneSerializer)
{
Console.WriteLine("EndlessDialogs library demonstration");
Console.WriteLine("----------------------------");
Console.WriteLine("Example");
Console.WriteLine("1) Linear conversation");
Console.WriteLine("2) Branched conversation");
Console.WriteLine("3) Save Scene");
Console.WriteLine("4) Load Scene");
int answer = ReadAnswerNumber(1, 4);
if (answer == 1)
ConversationRunner(scene.GetConversations().First());
else if(answer == 2)
ConversationRunner(scene.GetConversations().Skip(1).ToList().First());
else if (answer == 3)
{
sceneSerializer.Serialize(scene, fileName);
Console.WriteLine("Scene saved to file: TestScene.xml");
}
else if (answer == 4)
{
IScene loadedScene = sceneSerializer.Deserialize(fileName);
Console.WriteLine("Scene loaded from file: TestScene.xml");
ConversationRunner(loadedScene.GetConversations().Skip(1).ToList().First());
}
Console.WriteLine();
Console.WriteLine();
Console.WriteLine("----------------------------");
Console.WriteLine("More: \"" + webaddress + "\"");
Console.ReadKey();
}