Exemplo n.º 1
0
        private void WriteState(StateInfo state, XmlWriter writer)
        {
            writer.WriteStartElement("State");
            writer.WriteAttributeString("name", state.Name);

            writer.WriteStartElement("Initialize");
            foreach (var part in state.Initializer.Parts)
            {
                _effectWriter.WritePart(part, writer);
            }
            writer.WriteEndElement();

            writer.WriteStartElement("Logic");
            foreach (var part in state.Logic.Parts)
            {
                _effectWriter.WritePart(part, writer);
            }
            writer.WriteEndElement();

            foreach (var trigger in state.Triggers.OrderBy(t => t.Priority))
            {
                _triggerWriter.Write(trigger, writer);
            }

            writer.WriteEndElement();
        }
        public void Write(SceneCommandInfo info, XmlWriter writer)
        {
            var effect = (SceneEffectCommandInfo)info;

            writer.WriteStartElement("Effect");
            if (effect.EntityId != null)
            {
                writer.WriteAttributeString("entity", effect.EntityId);
            }

            foreach (var part in effect.EffectInfo.Parts)
            {
                _effectWriter.WritePart(part, writer);
            }

            writer.WriteEndElement();
        }