예제 #1
0
        public void Save(int itemNum)
        {
            if (!Directory.Exists(Paths.DataPath + "Item"))
            {
                Directory.CreateDirectory(Paths.DataPath + "Item");
            }
            using (XmlWriter writer = XmlWriter.Create(Paths.DataPath + "Item\\" + itemNum + ".xml", Logger.XmlWriterSettings))
            {
                writer.WriteStartDocument();
                writer.WriteStartElement("ItemEntry");

                #region Basic data

                writer.WriteStartElement("General");
                writer.WriteElementString("Name", Name);
                writer.WriteElementString("Description", Desc);
                writer.WriteElementString("ItemType", Type.ToString());
                writer.WriteElementString("Price", Price.ToString());
                writer.WriteElementString("Rarity", Rarity.ToString());
                writer.WriteElementString("Sprite", Sprite.ToString());
                writer.WriteElementString("Requirement", Req.ToString());
                writer.WriteElementString("Req1", Req1.ToString());
                writer.WriteElementString("Req2", Req2.ToString());
                writer.WriteElementString("Req3", Req3.ToString());
                writer.WriteElementString("Req4", Req4.ToString());
                writer.WriteElementString("Req5", Req5.ToString());
                writer.WriteElementString("Effect", Effect.ToString());
                writer.WriteElementString("Effect1", Effect1.ToString());
                writer.WriteElementString("Effect2", Effect2.ToString());
                writer.WriteElementString("Effect3", Effect3.ToString());
                writer.WriteElementString("ThrowEffect", ThrowEffect.ToString());
                writer.WriteElementString("Throw1", Throw1.ToString());
                writer.WriteElementString("Throw2", Throw2.ToString());
                writer.WriteElementString("Throw3", Throw3.ToString());
                writer.WriteEndElement();

                #endregion Basic data

                writer.WriteEndElement();
                writer.WriteEndDocument();
            }
        }
예제 #2
0
        public void Save(int moveNum)
        {
            if (!Directory.Exists(Paths.DataPath + "Move"))
            {
                Directory.CreateDirectory(Paths.DataPath + "Move");
            }
            using (XmlWriter writer = XmlWriter.Create(Paths.DataPath + "Move\\" + moveNum + ".xml", Logger.XmlWriterSettings)) {
                writer.WriteStartDocument();
                writer.WriteStartElement("MoveEntry");

                #region Basic data
                writer.WriteStartElement("General");
                writer.WriteElementString("Name", Name);
                writer.WriteElementString("Description", Desc);
                writer.WriteElementString("PP", PP.ToString());
                writer.WriteElementString("Type", Type.ToString());
                writer.WriteElementString("Category", Category.ToString());
                writer.WriteElementString("Contact", Contact.ToString());
                writer.WriteElementString("SoundBased", SoundBased.ToString());
                writer.WriteElementString("FistBased", FistBased.ToString());
                writer.WriteElementString("PulseBased", PulseBased.ToString());
                writer.WriteElementString("BulletBased", BulletBased.ToString());
                writer.WriteElementString("JawBased", BulletBased.ToString());
                writer.WriteElementString("Power", Power.ToString());
                writer.WriteElementString("Accuracy", Accuracy.ToString());
                writer.WriteElementString("Effect", Effect.ToString());
                writer.WriteElementString("Effect1", Effect1.ToString());
                writer.WriteElementString("Effect2", Effect2.ToString());
                writer.WriteElementString("Effect3", Effect3.ToString());
                writer.WriteElementString("HitsSelf", Range.HitsSelf.ToString());
                writer.WriteElementString("HitsFriend", Range.HitsFriend.ToString());
                writer.WriteElementString("HitsFoe", Range.HitsFoe.ToString());
                writer.WriteElementString("Range", Range.RangeType.ToString());
                writer.WriteElementString("Mobility", Range.Mobility.ToString());
                writer.WriteElementString("CutsCorners", Range.CutsCorners.ToString());
                writer.WriteElementString("Distance", Range.Distance.ToString());
                writer.WriteStartElement("StartAnim");
                StartAnim.Save(writer);
                writer.WriteEndElement();
                writer.WriteStartElement("StartUserAnim");
                StartUserAnim.Save(writer);
                writer.WriteEndElement();
                writer.WriteElementString("StartSound", StartSound.ToString());
                writer.WriteStartElement("MidAnim");
                MidAnim.Save(writer);
                writer.WriteEndElement();
                writer.WriteStartElement("MidUserAnim");
                MidUserAnim.Save(writer);
                writer.WriteEndElement();
                writer.WriteStartElement("MidTargetAnim");
                MidTargetAnim.Save(writer);
                writer.WriteEndElement();
                writer.WriteElementString("MidSound", MidSound.ToString());
                writer.WriteStartElement("EndAnim");
                EndAnim.Save(writer);
                writer.WriteEndElement();
                writer.WriteStartElement("EndUserAnim");
                EndUserAnim.Save(writer);
                writer.WriteEndElement();
                writer.WriteStartElement("EndTargetAnim");
                EndTargetAnim.Save(writer);
                writer.WriteEndElement();
                writer.WriteElementString("EndSound", EndSound.ToString());
                writer.WriteEndElement();
                #endregion

                writer.WriteEndElement();
                writer.WriteEndDocument();
            }
        }