00001 //Filename : OGAMESET.H 00002 //Description : Header file of Object GameSet 00003 00004 #ifndef __OGAMESET_H 00005 #define __OGAMESET_H 00006 00007 #ifndef __ORESX_H 00008 #include <ORESX.H> 00009 #endif 00010 00011 #ifndef __ODB_H 00012 #include <ODB.H> 00013 #endif 00014 00015 //-------- Define struct SetRec ---------// 00016 00018 struct SetRec { 00019 enum { CODE_LEN=8, DES_LEN=60 }; 00020 00021 char code[CODE_LEN]; 00022 char des[DES_LEN]; 00023 }; 00024 00025 //-------- Define struct SetInfo ---------// 00026 00029 struct SetInfo { 00030 enum { CODE_LEN=8, DES_LEN=60 }; 00031 00032 char code[CODE_LEN+1]; 00033 char des[DES_LEN+1]; 00034 }; 00035 00036 //-------- Define class GameSet ---------// 00037 00041 class GameSet { 00042 public: 00043 char init_flag; 00044 short cur_set_id; 00045 00046 short set_count; 00047 SetInfo* set_info_array; 00048 00049 ResourceIdx set_res; 00050 Database set_db; 00051 00052 char set_opened_flag; 00053 00054 public: 00055 GameSet() { init_flag=0; } 00056 ~GameSet() { deinit(); } 00057 00058 void init(); 00059 void deinit(); 00060 00061 char* cur_set_code() { return set_info_array[cur_set_id-1].code; } 00062 00063 void open_set(int); 00064 void close_set(); 00065 00066 Database* open_db(char*); 00067 Database* get_db(); 00068 00069 int find_set(char*); 00070 00071 SetInfo* operator()() { return set_info_array+cur_set_id-1; } 00072 SetInfo* operator[](int recNo) { return set_info_array+recNo-1; } 00073 00074 private: 00075 void load_set_header(); 00076 }; 00077 00078 //---------------------------------------// 00079 00080 extern GameSet game_set; 00081 #endif