Server.SkillHandlers.Inscribe.IsEmpty C# (CSharp) Méthode

IsEmpty() public static méthode

public static IsEmpty ( BaseBook book ) : bool
book Server.Items.BaseBook
Résultat bool
		public static bool IsEmpty( BaseBook book )
		{
			foreach ( BookPageInfo page in book.Pages )
			{
				foreach ( string line in page.Lines )
				{
					if ( line.Trim().Length != 0 )
						return false;
				}
			}
			return true;
		}

Usage Example

            protected override void OnTarget(Mobile from, object targeted)
            {
                BaseBook book = targeted as BaseBook;

                if (book == null)
                {
                    from.SendLocalizedMessage(1046296);                       // That is not a book
                }
                else if (Inscribe.IsEmpty(book))
                {
                    from.SendLocalizedMessage(501611);                       // Can't copy an empty book.
                }
                else if (Inscribe.GetUser(book) != null)
                {
                    from.SendLocalizedMessage(501621);                       // Someone else is inscribing that item.
                }
                else
                {
                    Target target = new InternalTargetDst(book);
                    from.Target = target;
                    from.SendLocalizedMessage(501612);                       // Select a book to copy this to.
                    target.BeginTimeout(from, TimeSpan.FromMinutes(1.0));
                    Inscribe.SetUser(book, from);
                }
            }
All Usage Examples Of Server.SkillHandlers.Inscribe::IsEmpty