00001 /*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 00002 || NoX-Wizard UO Server Emulator (NXW) [http://noxwizard.sourceforge.net] || 00003 || || 00004 || This software is free software released under GPL2 license. || 00005 || You can find detailed license information in nox-wizard.cpp file. || 00006 || || 00007 || For any question post to NoX-Wizard forums. || 00008 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/ 00009 00010 00011 //file gmpages.h 00012 //by Frodo & Stonedz 00013 00014 #ifndef __GMPAGES_H 00015 #define __GMPAGES_H 00016 00017 #include "common_libs.h" 00018 #include "nxwcommn.h" 00019 00020 typedef class cGmpage* P_GMPAGE; 00021 00022 00023 00024 00025 class cGmpage{ 00026 00027 00028 private: 00029 00030 SERIAL serial; 00031 std::string reason; 00032 std::string timeofcall; 00033 P_GMPAGE next_page; //next page of the same char 00034 P_GMPAGE prev_page; //previous page of the same char 00035 UI08 page_number; //page's number 00036 00037 public: 00038 00039 cGmpage(SERIAL serialg, std::string reasong); 00040 00041 std::string getReason(); 00042 std::string getTime(); 00043 UI08 getPageNumber (); 00044 P_GMPAGE getNextPage (); 00045 P_GMPAGE getPrevPage (); 00046 SERIAL getSerial (); 00047 UI08 setPageNumber (UI08 new_page_number); 00048 P_GMPAGE setNextPage (P_GMPAGE new_next_page); 00049 P_GMPAGE setPrevPage (P_GMPAGE new_prev_page); 00050 00051 00052 00053 }; 00054 00055 00056 class cGmpagesMap{ 00057 00058 private: 00059 00060 static std::map< SERIAL, P_GMPAGE > gmpages_map; // SERIAL of the player. Contains all pages. 00061 00062 public: 00063 00064 cGmpagesMap(); 00065 P_GMPAGE addPage(P_GMPAGE page); 00066 P_GMPAGE findPage(SERIAL serial); 00067 P_GMPAGE findPage(SERIAL serial, UI08 page_num); 00068 bool deletePage(SERIAL serial, UI08 page_num); 00069 SERIAL_VECTOR getAllPagers(); 00070 bool optimize_page_indexes(SERIAL serial); 00071 00072 00073 }; 00074 00075 #endif