[Package Index | Mudlib Index | Effect Index]
Each page is an object. Pages that are torn out are handled as empty spots in the array.
Written by Pinkfish
.
int add_page_after(object page, int after)This method adds a new page in after the selected page. The pages are numbered from 1, so adding a page after page 0 will place a page on the start and after the last page onto the end.
object create_default_page_object()This method creates a new default page object for this book. THis can be used for whatever nefarious purposes you want.
int is_current_page_torn_out()This method checks to see if the current page is torn out.
int is_default_page(int num)This method checks to see if the page is still the default page object or if it is something else altogether.
int is_page_torn_out(int page)This method checks to see if the specified page is torn out.
int make_page_blank(int num)This method makes the selected page blank. It defaults it back to a default page object as if the book had just been created.
int query_book()Tells us if this is a book object.
int query_book_num()This method returns the current number of the book. This is assigned and used in conjunction with the book handler.
object query_current_page()Returns the object associated with the current open page. If the page does not actualy exist yet then the default base object is returned. This object should be handled carefully... If the page is torn out then the next readable page is returned or 0 is returned.
object query_current_page_clone()This function makes sure the page actually exists. If it does not exist, then it will clone one up for us. This one should be used as you will not end up with the base object in this case. If you are planning to modify the page, then use this call.
string query_default_page_object()This method returns the default page object.
int query_ignore_saved_pages()This method returns the current setting of the ignore saved pages variable. If this is true then the pages form the players auto_load stuff will be ignored totaly and only the page creates in setup would be used.
int query_num_pages()Queries the number of pages in the book.
int query_open_page()What is the current open page. Returns 0 if the book is not open.
mixed * query_pages()Returns the pages array.
object query_player()This method will return the player associated with the auto loading process.
object query_selected_page(int num)This method returns the contents of the selected page. The number must be greator than 0. This will return the exact value of the page, it will not search for non-torn out pages. Becare with the return value of this as the default page object might be returned if the page does not actually exist. If you need a real object remember to use the clone version.
object query_selected_page_clone(int num)This method returns the contents of the selected page, if a default object is returned a real clone for the page is created instead.
int replace_page_with(object page, int num)This method replaces the selected page with a new page. The old page is dested if it can be and replaced with a nice shiny new page object.
void set_book_num(int num)This method sets the current number of the book. This is assigned and used in conjunction with the book handler.
void set_default_page_object(string obj)Sets the object to use as the default page. If this is not set the the object /obj/misc/paper.c will be used.
void set_no_pages(int no)Set the number of pages in the book. If there are too many pages in the book, then pages are removed from the top to create the correct size and if there are too few pages then pages are added onto the end of the pages array.
void set_open_page(int i)Sets the currently open page. This does all the magic needed to make the book appear as if it is the currently opened page. If the open page is 0 then the book is closed. If it is out of the upper bound then the book is opened to the last page.
void set_player(object player)This method is called by the auto loading process to set the current player on this object.
object tear_current_page_out(object dest)This method tears the current page out of the book and returns it to us. This object will be moved into the destination so that it is no longer inside us. If it cannot be moved of the page has already been remove then the function will return 0.
void set_ignore_saved_pages(int saved)This method sets the current setting of the ignore saved pages variable. If this is true then the pages form the players auto_load stuff will be ignored totaly and only the page creates in setup would be used. This can only be called from an object which inherits this one (hence the protected method).