00001
00002
00003
00004
00005
00006
00007
00008
00009
00015 #ifndef __WORLDMAIN_H_
00016 #define __WORLDMAIN_H_
00017
00018
00019 void split( std::string& souce, std::string& first, std::string& second );
00020
00021 class cStringFile {
00022
00023 public:
00024
00025 std::ifstream *inStream;
00026
00027 public:
00028
00029 cStringFile( std::string& path, const char* mode );
00030 ~cStringFile();
00031
00032 void read( std::string& line );
00033 void read( std::string& l, std::string& r );
00034 void read( std::string& first, std::string& second, std::string& third );
00035
00036 bool eof();
00037 };
00038
00039
00040
00041 class CWorldMain
00042 {
00043 private:
00044
00045 FILE* iWsc;
00046 FILE* cWsc;
00047 FILE* jWsc;
00048 FILE* gWsc;
00049
00050 bool isSaving;
00051
00052 UI32 itm_curr, chr_curr;
00053
00054 void SaveChar( P_CHAR pc );
00055 void SaveBinaryChar( fstream *out, P_CHAR pc);
00056
00057 void loadChar();
00058
00059 void SaveItem( P_ITEM pi );
00060 void SaveBinaryItem( fstream *out, P_ITEM pi);
00061 void loadItem();
00062
00063 void realworldsave();
00064
00065 void loadGuilds();
00066
00067 void loadjailed();
00068 void loadPrison();
00069 void savePrison();
00070
00071 public:
00072
00073 CWorldMain();
00074 ~CWorldMain();
00075
00076 void loadNewWorld();
00077 void saveNewWorld();
00078 void binarySaveWorld();
00079 void binaryLoadWorld();
00080 bool Saving();
00081 };
00082
00083 void fprintWstring( FILE* f, char* name, wstring c );
00084 wstring HexVector2UnicodeString( char* s );
00085
00086 extern class CWorldMain* cwmWorldState;
00087
00088
00089 #endif // WORLDMAIN