Created
July 5, 2019 01:09
-
-
Save Kr3m/442bb7d67c2146285209ebfe556c3102 to your computer and use it in GitHub Desktop.
Testing Dialogue from XML
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void TestDialogue() | |
{ | |
var dialogue = GameDialogue.DialogueList; | |
for (var i = 0; i < dialogue.Count; i++) | |
{ | |
var current = dialogue[i]; | |
var ouputs = current.OutputIds; | |
var currentOutputCount = current.OutputIds.Count; | |
for (var j = 0; j < ouputs.Count; j++) | |
{ | |
var nextConnection = GameDialogue.ConnectionList.FirstOrDefault(c => c.Source.PinRef == ouputs[j]); | |
if (nextConnection == null) continue; | |
var nextDialogue = dialogue.FirstOrDefault(d => d.Id == nextConnection.Target.IdRef); | |
var nextOutputCount = nextDialogue.OutputIds.Count; | |
if (nextOutputCount == currentOutputCount) | |
{ | |
//Insert breakpoint here | |
var problemDialogue = current.DisplayText; | |
var problemRetort = nextDialogue.DisplayText; | |
} | |
} | |
} | |
} | |
private static void ExportDialogue() | |
{ | |
const string fileName = "dialogue-output.xml"; | |
FlatRedBall.IO.FileManager.XmlSerialize(GameDialogue, fileName); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment