Skip to content

Instantly share code, notes, and snippets.

@Kr3m
Created July 5, 2019 01:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kr3m/442bb7d67c2146285209ebfe556c3102 to your computer and use it in GitHub Desktop.
Save Kr3m/442bb7d67c2146285209ebfe556c3102 to your computer and use it in GitHub Desktop.
Testing Dialogue from XML
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