本文整理汇总了C#中Server.Items.BaseBook.Delete方法的典型用法代码示例。如果您正苦于以下问题:C# BaseBook.Delete方法的具体用法?C# BaseBook.Delete怎么用?C# BaseBook.Delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Items.BaseBook
的用法示例。
在下文中一共展示了BaseBook.Delete方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Publish
private void Publish(Mobile contributor, BaseBook book)
{
PublishedBook publishedBook = book as PublishedBook;
if(publishedBook != null)
{
publishedBook.AddContributor(contributor.Name);
Republish(contributor, publishedBook);
return;
}
// change into published book
publishedBook = new PublishedBook(book);
publishedBook.AddContributor(contributor.Name);
if(!publishedBook.IsPublishable())
{
publishedBook.Delete();
this.SayTo(contributor, "You might want to try writing something of interest first.");
}
else if(XmlBook.Save(publishedBook))
{
switch (Utility.Random( 3 ) )
{
case 0:
{
contributor.AddToBackpack(new Gold(1500, 3000));
this.SayTo(contributor, "This seems to be a excellent material. Let me see... hm... here - your royalty. You should see the story soon. I am sure it will sell well.");
contributor.SendMessage("You receive a good amount of gold.");
if (m_Sound)
Effects.PlaySound(contributor.Location, contributor.Map, 0x2E5);
contributor.AddToBackpack(publishedBook);
book.Delete();
break;
}
case 1:
{
contributor.AddToBackpack(new Gold(1000, 1250));
this.SayTo(contributor, "This seems to be decent material. Let me see... hm... here - your royalty. You should see the story soon. I hope it will sell well.");
contributor.SendMessage("You receive a decent amount of gold.");
if (m_Sound)
Effects.PlaySound(contributor.Location, contributor.Map, 0x2E5);
contributor.AddToBackpack(publishedBook);
book.Delete();
break;
}
case 2:
{
contributor.AddToBackpack(new Gold(100, 500));
this.SayTo(contributor, "I don't know if this is good enough to be sold, but let me see... hm... here - I can't give you more for this. I am not sure it will sell at all.");
contributor.SendMessage("You receive some gold.");
if (m_Sound)
Effects.PlaySound(contributor.Location, contributor.Map, 0x2E5);
contributor.AddToBackpack(publishedBook);
book.Delete();
break;
}
}
}
else
{
publishedBook.Delete();
this.SayTo(contributor, "Our machines are not working right. Check back later.");
}
}