当前位置: 首页>>代码示例>>C#>>正文


C# BaseBook.Delete方法代码示例

本文整理汇总了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.");
			}
		}
开发者ID:greeduomacro,项目名称:unknown-shard-1,代码行数:69,代码来源:Publisher.cs


注:本文中的Server.Items.BaseBook.Delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。