コード例 #1
0
 /// <summary>
 /// Print the object's XML to the XmlWriter.
 /// </summary>
 /// <param name="objWriter">XmlTextWriter to write with.</param>
 /// <param name="objCulture">Culture in which to print numbers.</param>
 /// <param name="strLanguageToPrint">Language in which to print.</param>
 public void Print(XmlTextWriter objWriter, CultureInfo objCulture, string strLanguageToPrint)
 {
     objWriter.WriteStartElement("spell");
     if (Limited)
     {
         objWriter.WriteElementString("name", DisplayNameShort(strLanguageToPrint) + LanguageManager.GetString("String_Space", strLanguageToPrint) + '(' + LanguageManager.GetString("String_SpellLimited", strLanguageToPrint) + ')');
     }
     else if (Alchemical)
     {
         objWriter.WriteElementString("name", DisplayNameShort(strLanguageToPrint) + LanguageManager.GetString("String_Space", strLanguageToPrint) + '(' + LanguageManager.GetString("String_SpellAlchemical", strLanguageToPrint) + ')');
     }
     else
     {
         objWriter.WriteElementString("name", DisplayNameShort(strLanguageToPrint));
     }
     objWriter.WriteElementString("name_english", Name);
     objWriter.WriteElementString("descriptors", DisplayDescriptors(strLanguageToPrint));
     objWriter.WriteElementString("category", DisplayCategory(strLanguageToPrint));
     objWriter.WriteElementString("category_english", Category);
     objWriter.WriteElementString("type", DisplayType(strLanguageToPrint));
     objWriter.WriteElementString("range", DisplayRange(strLanguageToPrint));
     objWriter.WriteElementString("damage", DisplayDamage(strLanguageToPrint));
     objWriter.WriteElementString("duration", DisplayDuration(strLanguageToPrint));
     objWriter.WriteElementString("dv", DisplayDV(strLanguageToPrint));
     objWriter.WriteElementString("alchemy", Alchemical.ToString());
     objWriter.WriteElementString("dicepool", DicePool.ToString(objCulture));
     objWriter.WriteElementString("source", CommonFunctions.LanguageBookShort(Source, strLanguageToPrint));
     objWriter.WriteElementString("page", DisplayPage(strLanguageToPrint));
     objWriter.WriteElementString("extra", LanguageManager.TranslateExtra(Extra, strLanguageToPrint));
     if (_objCharacter.Options.PrintNotes)
     {
         objWriter.WriteElementString("notes", Notes);
     }
     objWriter.WriteEndElement();
 }
コード例 #2
0
 /// <summary>
 /// Print the object's XML to the XmlWriter.
 /// </summary>
 /// <param name="objWriter">XmlTextWriter to write with.</param>
 /// <param name="objCulture">Culture in which to print numbers.</param>
 /// <param name="strLanguageToPrint">Language in which to print.</param>
 public void Print(XmlTextWriter objWriter, CultureInfo objCulture, string strLanguageToPrint)
 {
     if (objWriter == null)
     {
         return;
     }
     objWriter.WriteStartElement("spell");
     objWriter.WriteElementString("guid", InternalId);
     objWriter.WriteElementString("sourceid", SourceIDString);
     if (Limited)
     {
         objWriter.WriteElementString("name", string.Format(objCulture, "{0}{1}({2})",
                                                            DisplayNameShort(strLanguageToPrint), LanguageManager.GetString("String_Space", strLanguageToPrint), LanguageManager.GetString("String_SpellLimited", strLanguageToPrint)));
     }
     else if (Alchemical)
     {
         objWriter.WriteElementString("name", string.Format(objCulture, "{0}{1}({2})",
                                                            DisplayNameShort(strLanguageToPrint), LanguageManager.GetString("String_Space", strLanguageToPrint), LanguageManager.GetString("String_SpellAlchemical", strLanguageToPrint)));
     }
     else
     {
         objWriter.WriteElementString("name", DisplayNameShort(strLanguageToPrint));
     }
     objWriter.WriteElementString("name_english", Name);
     objWriter.WriteElementString("descriptors", DisplayDescriptors(strLanguageToPrint));
     objWriter.WriteElementString("category", DisplayCategory(strLanguageToPrint));
     objWriter.WriteElementString("category_english", Category);
     objWriter.WriteElementString("type", DisplayType(strLanguageToPrint));
     objWriter.WriteElementString("range", DisplayRange(strLanguageToPrint));
     objWriter.WriteElementString("damage", DisplayDamage(strLanguageToPrint));
     objWriter.WriteElementString("duration", DisplayDuration(strLanguageToPrint));
     objWriter.WriteElementString("dv", DisplayDV(strLanguageToPrint));
     objWriter.WriteElementString("alchemy", Alchemical.ToString(GlobalOptions.InvariantCultureInfo));
     objWriter.WriteElementString("dicepool", DicePool.ToString(objCulture));
     objWriter.WriteElementString("source", CommonFunctions.LanguageBookShort(Source, strLanguageToPrint));
     objWriter.WriteElementString("page", DisplayPage(strLanguageToPrint));
     objWriter.WriteElementString("extra", LanguageManager.TranslateExtra(Extra, strLanguageToPrint));
     if (_objCharacter.Options.PrintNotes)
     {
         objWriter.WriteElementString("notes", Notes);
     }
     objWriter.WriteEndElement();
 }