public void Write(SceneCommandInfo info, XmlWriter writer)
 {
     var call = (SceneCallCommandInfo)info;
     writer.WriteStartElement("Call");
     writer.WriteValue(call.Name);
     writer.WriteEndElement();
 }
        public void Write(SceneCommandInfo info, XmlWriter writer)
        {
            var play = (ScenePlayCommandInfo)info;

            writer.WriteStartElement("PlayMusic");
            writer.WriteAttributeString("track", play.Track.ToString());
            writer.WriteEndElement();
        }
        public void Write(SceneCommandInfo info, XmlWriter writer)
        {
            var remove = (SceneRemoveCommandInfo)info;

            writer.WriteStartElement("Remove");
            writer.WriteAttributeString("name", remove.Name);
            writer.WriteEndElement();
        }
        public void Write(SceneCommandInfo info, XmlWriter writer)
        {
            if (!_writers.ContainsKey(info.GetType()))
                throw new Exception("No xml writer found for command type: " + info.GetType().Name);

            var cmdWriter = _writers[info.GetType()];
            cmdWriter.Write(info, writer);
        }
        public void Write(SceneCommandInfo info, XmlWriter writer)
        {
            var scroll = (SceneAutoscrollCommandInfo)info;

            writer.WriteStartElement("Autoscroll");

            writer.WriteAttributeString("speed", scroll.Speed.ToString());
            writer.WriteAttributeString("startX", scroll.StartX.ToString());

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

            writer.WriteStartElement("Move");
            if (!string.IsNullOrEmpty(move.Name)) writer.WriteAttributeString("name", move.Name);
            writer.WriteAttributeString("x", move.X.ToString());
            writer.WriteAttributeString("y", move.Y.ToString());
            if (move.Duration > 0) writer.WriteAttributeString("duration", move.Duration.ToString());
            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();
        }
        public void Write(SceneCommandInfo info, XmlWriter writer)
        {
            var fill = (SceneFillMoveCommandInfo)info;

            writer.WriteStartElement("FillMove");
            if (!string.IsNullOrEmpty(fill.Name)) writer.WriteAttributeString("name", fill.Name);
            writer.WriteAttributeString("x", fill.X.ToString());
            writer.WriteAttributeString("y", fill.Y.ToString());
            writer.WriteAttributeString("width", fill.Width.ToString());
            writer.WriteAttributeString("height", fill.Height.ToString());
            writer.WriteAttributeString("duration", fill.Duration.ToString());
            writer.WriteEndElement();
        }
        public void Write(SceneCommandInfo info, XmlWriter writer)
        {
            var fill = (SceneFillCommandInfo)info;

            writer.WriteStartElement("Fill");
            if (!string.IsNullOrEmpty(fill.Name)) writer.WriteAttributeString("name", fill.Name);
            writer.WriteAttributeString("color", fill.Red.ToString() + "," + fill.Green.ToString() + "," + fill.Blue.ToString());
            writer.WriteAttributeString("x", fill.X.ToString());
            writer.WriteAttributeString("y", fill.Y.ToString());
            writer.WriteAttributeString("width", fill.Width.ToString());
            writer.WriteAttributeString("height", fill.Height.ToString());
            writer.WriteAttributeString("layer", fill.Layer.ToString());
            writer.WriteEndElement();
        }
        public void Write(SceneCommandInfo info, XmlWriter writer)
        {
            var text = (SceneTextCommandInfo)info;

            writer.WriteStartElement("Text");
            if (!string.IsNullOrEmpty("Font")) writer.WriteAttributeString("font", text.Font);
            if (!string.IsNullOrEmpty(text.Name)) writer.WriteAttributeString("name", text.Name);
            writer.WriteAttributeString("content", text.Content);
            if (text.Speed != null) writer.WriteAttributeString("speed", text.Speed.Value.ToString());
            writer.WriteAttributeString("x", text.X.ToString());
            writer.WriteAttributeString("y", text.Y.ToString());

            if (text.Binding != null)
                _bindingWriter.Write(text.Binding, writer);

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

            writer.WriteStartElement("Condition");

            if (cmd.ConditionEntity != null)
                writer.WriteAttributeString("entity", cmd.ConditionEntity);

            writer.WriteAttributeString("condition", cmd.ConditionExpression);

            foreach (var c in cmd.Commands)
            {
                _commandWriter.Write(c, writer);
            }

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

            writer.WriteStartElement("Option");

            if (option.Name != null)
                writer.WriteAttributeString("name", option.Name);

            writer.WriteAttributeString("x", option.X.ToString());
            writer.WriteAttributeString("y", option.Y.ToString());

            if (option.OnEvent != null)
            {
                writer.WriteStartElement("On");
                foreach (var cmd in option.OnEvent)
                {
                    Write(cmd, writer);
                }
                writer.WriteEndElement();
            }

            if (option.OffEvent != null)
            {
                writer.WriteStartElement("Off");
                foreach (var cmd in option.OffEvent)
                {
                    Write(cmd, writer);
                }
                writer.WriteEndElement();
            }

            if (option.SelectEvent != null)
            {
                writer.WriteStartElement("Select");
                foreach (var cmd in option.SelectEvent)
                {
                    Write(cmd, writer);
                }
                writer.WriteEndElement();
            }

            writer.WriteEndElement();
        }
 public void Write(SceneCommandInfo info, XmlWriter writer)
 {
     var next = (SceneNextCommandInfo)info;
     _transferWriter.Write(next.NextHandler, writer);
 }
Beispiel #14
0
 protected override void RunCommand(SceneCommandInfo cmd)
 {
     if (cmd.Type == SceneCommands.WaitForInput)
     {
         waiting = true;
     }
     else
     {
         base.RunCommand(cmd);
     }
 }
        public void Write(SceneCommandInfo info, XmlWriter writer)
        {
            var entity = (SceneEntityCommandInfo)info;

            _entityWriter.Write(entity.Placement, writer);
        }
 public void Write(SceneCommandInfo info, XmlWriter writer)
 {
     writer.WriteElementString("WaitForInput", "");
 }
Beispiel #17
0
        protected virtual void RunCommand(SceneCommandInfo cmd)
        {
            switch (cmd.Type)
            {
                case SceneCommands.PlayMusic:
                    PlayMusicCommand((ScenePlayCommandInfo)cmd);
                    break;

                case SceneCommands.StopMusic:
                    StopMusicCommand((SceneStopMusicCommandInfo)cmd);
                    break;

                case SceneCommands.Add:
                    AddCommand((SceneAddCommandInfo)cmd);
                    break;

                case SceneCommands.Move:
                    MoveCommand((SceneMoveCommandInfo)cmd);
                    break;

                case SceneCommands.Remove:
                    RemoveCommand((SceneRemoveCommandInfo)cmd);
                    break;

                case SceneCommands.Entity:
                    EntityCommand((SceneEntityCommandInfo)cmd);
                    break;

                case SceneCommands.Text:
                    TextCommand((SceneTextCommandInfo)cmd);
                    break;

                case SceneCommands.Fill:
                    FillCommand((SceneFillCommandInfo)cmd);
                    break;

                case SceneCommands.FillMove:
                    FillMoveCommand((SceneFillMoveCommandInfo)cmd);
                    break;

                case SceneCommands.Sound:
                    SoundCommand((SceneSoundCommandInfo)cmd);
                    break;

                case SceneCommands.Next:
                    NextCommand((SceneNextCommandInfo)cmd);
                    break;

                case SceneCommands.Call:
                    CallCommand((SceneCallCommandInfo)cmd);
                    break;

                case SceneCommands.Effect:
                    EffectCommand((SceneEffectCommandInfo)cmd);
                    break;

                case SceneCommands.Condition:
                    ConditionCommand((SceneConditionCommandInfo)cmd);
                    break;
            }
        }
Beispiel #18
0
 protected override void RunCommand(SceneCommandInfo cmd)
 {
     // stage handlers only run a subset of all commands
     // entities aren't included because we handle them in a totally different way
     if (cmd.Type == SceneCommands.Call || cmd.Type == SceneCommands.Condition || cmd.Type == SceneCommands.Effect ||
         cmd.Type == SceneCommands.Next || cmd.Type == SceneCommands.PlayMusic || cmd.Type == SceneCommands.Sound || cmd.Type == SceneCommands.StopMusic)
     {
         base.RunCommand(cmd);
     }
 }