本文整理匯總了C#中Server.Items.Runebook.Delete方法的典型用法代碼示例。如果您正苦於以下問題:C# Runebook.Delete方法的具體用法?C# Runebook.Delete怎麽用?C# Runebook.Delete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Server.Items.Runebook
的用法示例。
在下文中一共展示了Runebook.Delete方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: AddRunebook
public bool AddRunebook(Mobile m, Runebook book, bool message)
{
if (m == null || m.Deleted || book == null || book.Deleted)
{
return false;
}
bool mrb = Insensitive.Equals(book.GetType().Name, "InternalRunebook");
if (book.Entries.Count == 0)
{
if (!mrb && message)
{
m.SendMessage("That rune book is empty.");
}
return false;
}
if (Entries.Count >= Entries.Capacity)
{
if (!mrb && message)
{
m.SendMessage("The category \"{0}\" can't hold more runes.", _Name);
}
return false;
}
if (Entries.Count + book.Entries.Count > Entries.Capacity)
{
if (!mrb && message)
{
m.SendMessage("That rune book won't fit in the category \"{0}\".", _Name);
}
return false;
}
var bEntries = new Queue<RunebookEntry>(book.Entries);
Entries.ForEach(
(e, x, y) =>
{
if (e != null || bEntries.Count <= 0)
{
return;
}
var be = bEntries.Dequeue();
Entries.SetContent(x, y, new RuneCodexEntry(book.Name, be.Description, be.Location.ToMapPoint(be.Map)));
});
if (mrb)
{
book.Entries.Clear();
return true;
}
book.Delete();
if (message)
{
m.SendMessage("You add the rune book to the category \"{0}\".", _Name);
}
return true;
}