本文整理汇总了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;
}