コード例 #1
0
 public void Write(SceneCommandInfo info, XmlWriter writer)
 {
     var call = (SceneCallCommandInfo)info;
     writer.WriteStartElement("Call");
     writer.WriteValue(call.Name);
     writer.WriteEndElement();
 }
コード例 #2
0
        public void Write(SceneCommandInfo info, XmlWriter writer)
        {
            var play = (ScenePlayCommandInfo)info;

            writer.WriteStartElement("PlayMusic");
            writer.WriteAttributeString("track", play.Track.ToString());
            writer.WriteEndElement();
        }
コード例 #3
0
        public void Write(SceneCommandInfo info, XmlWriter writer)
        {
            var remove = (SceneRemoveCommandInfo)info;

            writer.WriteStartElement("Remove");
            writer.WriteAttributeString("name", remove.Name);
            writer.WriteEndElement();
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        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();
        }
コード例 #6
0
        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();
        }
コード例 #7
0
        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();
        }
コード例 #8
0
        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();
        }
コード例 #9
0
        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();
        }
コード例 #10
0
        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();
        }
コード例 #11
0
        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();
        }
コード例 #12
0
        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();
        }
コード例 #13
0
 public void Write(SceneCommandInfo info, XmlWriter writer)
 {
     var next = (SceneNextCommandInfo)info;
     _transferWriter.Write(next.NextHandler, writer);
 }
コード例 #14
0
ファイル: Scene.cs プロジェクト: laazer/cs_megaman
 protected override void RunCommand(SceneCommandInfo cmd)
 {
     if (cmd.Type == SceneCommands.WaitForInput)
     {
         waiting = true;
     }
     else
     {
         base.RunCommand(cmd);
     }
 }
コード例 #15
0
        public void Write(SceneCommandInfo info, XmlWriter writer)
        {
            var entity = (SceneEntityCommandInfo)info;

            _entityWriter.Write(entity.Placement, writer);
        }
コード例 #16
0
 public void Write(SceneCommandInfo info, XmlWriter writer)
 {
     writer.WriteElementString("WaitForInput", "");
 }
コード例 #17
0
ファイル: GameHandler.cs プロジェクト: laazer/cs_megaman
        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;
            }
        }
コード例 #18
0
ファイル: StageHandler.cs プロジェクト: laazer/cs_megaman
 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);
     }
 }