Exemplo n.º 1
0
        /// <summary>
        /// Saves properties
        /// </summary>
        /// <param name="writer">XmlWriter</param>
        /// <returns>True if saved</returns>
        public virtual bool Save(XmlWriter writer)
        {
            if (writer == null || writer.WriteState != WriteState.Element)
            {
                return(false);
            }

            HitPoint.Save(writer);
            Strength.Save("strength", writer);
            Intelligence.Save("intelligence", writer);
            Wisdom.Save("wisdom", writer);
            Dexterity.Save("dexterity", writer);
            Constitution.Save("constitution", writer);
            Charisma.Save("charisma", writer);

            writer.WriteStartElement("alignment");
            writer.WriteAttributeString("value", Alignment.ToString());
            writer.WriteEndElement();

            writer.WriteStartElement("movespeed");
            writer.WriteAttributeString("value", MoveSpeed.TotalMilliseconds.ToString());
            writer.WriteEndElement();


            return(true);
        }