import System.IO
import System.Xml
import System.Xml.Serialization
using w = XmlWriter.Create(Console.Out):
w.WriteStartDocument()
w.WriteWhitespace("\n")
w.WriteStartElement("scene")
w.WriteAttributeString("name", "intro")
w.WriteAttributeString("desc", "in which out hero...")
w.WriteAttributeString("default", "waking_up")
w.WriteWhitespace("\n ")
w.WriteStartElement("narrative")
w.WriteAttributeString("name", "waking_up")
w.WriteAttributeString("desc", "how much did I have to drink last night?")
w.WriteEndElement()
w.WriteWhitespace("\n")
w.WriteEndElement()
w.WriteWhitespace("\n")
Which outputs this:
<scene name="intro" desc="in which out hero..." default="waking_up">
<narrative name="waking_up" desc="how much did I have to drink last night?" />
</scene>
I think I can work with that. Let's add some snippets to the mix:
<?xml version="1.0" encoding="us-ascii"?>
<scene name="intro" desc="in which out hero..." default="waking_up">
<narrative name="waking_up" desc="how much did I have to drink last night?">
<snippet>I'm cold.</snippet>
<snippet>Cold and wet and ... naked?</snippet>
<snippet>Oh man.</snippet>
<snippet>How much did I have to drink last night, anyway?</snippet>
</narrative>
</scene>
That's the level of control I need. Now to redo the save and load funcs.
Hmm... that's a point. Let's make sure I can read this stuff
No comments:
Post a Comment