Virtual U.org
Get Personal Training on VU Today
    
Top shadow
 
 register/help
User Name:

Password:

Oinfo.h Source File
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

Oinfo.h

Go to the documentation of this file.
00001 //Filename        : OINFO.H
00002 //Description : Header file for class Info
00003 
00004 #ifndef __OINFO_H
00005 #define __OINFO_H
00006 
00007 #include <OIMGRES.H>
00008 
00009 //-------- Define interface constant --------//
00010 
00011 enum {  REPORT_ITEMS = 7  };
00012 
00013 enum {
00014     MENU_BUTTON_X1 = 753,
00015     MENU_BUTTON_Y1 = 0,
00016     MENU_BUTTON_X2 = 797,
00017     MENU_BUTTON_Y2 = 29
00018 };
00019 
00020 enum {
00021     REPORT_BUTTON_X1 = 0,
00022     REPORT_BUTTON_Y1 = 0,
00023     REPORT_BUTTON_X2 = 360,
00024     REPORT_BUTTON_Y2 = 31
00025 };
00026 
00027 enum {
00028     COLUMN_WIDTH  = 25,
00029     COLUMN_HEIGHT = 50
00030 };
00031 
00032 enum {
00033     SURPLUS_INFO_X1 = 370,
00034     SURPLUS_INFO_Y1 = 5,
00035     SURPLUS_INFO_X2 = 500,
00036     SURPLUS_INFO_Y2 = 23
00037 };
00038 
00039 enum {
00040     SCORE_INFO_X1 = 544,
00041     SCORE_INFO_Y1 = 11,
00042     SCORE_INFO_X2 = 570,
00043     SCORE_INFO_Y2 = 31
00044 };
00045 
00046 enum {
00047     U_SCORE_INFO_X1 = 624,
00048     U_SCORE_INFO_Y1 = 11,
00049     U_SCORE_INFO_X2 = 650,
00050     U_SCORE_INFO_Y2 = 31
00051 };
00052 
00053 enum {
00054     MONTH_X1      = 662,
00055     MONTH_Y1      = 11,
00056     SEASON_X1   = 704,
00057     SEASON_Y1   = 11,
00058     DAY_X1      = 663,
00059     DAY_X2      = 700,
00060     YEAR_X1     = 707,
00061     YEAR_X2     = 745,
00062     DIGIT_Y1      = 25,
00063     DIGIT_Y2      = 38,
00064 };
00065 
00066 enum {
00067     DATE_INFO_X1  = 663,
00068     DATE_INFO_Y1  = 25,
00069     DATE_INFO_X2  = 700,
00070     DATE_INFO_Y2  = 38,
00071 };
00072 
00073 enum {
00074     YEAR_INFO_X1  = 706,
00075     YEAR_INFO_Y1  = 25,
00076     YEAR_INFO_X2  = 744,
00077     YEAR_INFO_Y2  = 38,
00078 };
00079 
00080 enum {
00081     TOP_INFO_X1 = 150,                              //222,
00082     TOP_INFO_Y1 = 27,
00083     TOP_INFO_X2 = 570,
00084     TOP_INFO_Y2 = 43
00085 };
00086 
00087 enum {
00088     BOTTOM_INFO_X1  = 122,
00089     BOTTOM_INFO_Y1  = 488,
00090     BOTTOM_INFO_X2  = 684,
00091     BOTTOM_INFO_Y2  = 506,
00092 };
00093 
00094 enum {
00095     MORE_REPORT_X1  = 10,
00096     MORE_REPORT_Y1  = 28,
00097     MORE_REPORT_X2  = 150,
00098     MORE_REPORT_Y2  = 45
00099 };
00100 
00101 enum {
00102     HELP_QUEST_X1 = 772,
00103     HELP_QUEST_Y1 = 29,
00104     HELP_QUEST_X2 = 795,
00105     HELP_QUEST_Y2 = 46
00106 };
00107 
00108 enum {
00109     LIST_BUTTON_X1  = 630,
00110     LIST_BUTTON_Y1  = 31,
00111     LIST_BUTTON_X2  = 645,
00112     LIST_BUTTON_Y2  = 45
00113 };
00114 
00115 enum {
00116     GRAPH1_X1=450,GRAPH1_X2=600,
00117     GRAPH1_Y1=80,GRAPH1_Y2=180,
00118     GRAPH2_X1=450,GRAPH2_X2=600,
00119     GRAPH2_Y1=210,GRAPH2_Y2=310,
00120     GRAPH3_X1=450,GRAPH3_X2=600,
00121     GRAPH3_Y1=340,GRAPH3_Y2=440,
00122     GRAPH4_X1=610,GRAPH4_X2=760,
00123     GRAPH4_Y1=80,GRAPH4_Y2=180,
00124     GRAPH5_X1=610,GRAPH5_X2=760,
00125     GRAPH5_Y1=210,GRAPH5_Y2=310,
00126     GRAPH6_X1=610,GRAPH6_X2=760,
00127     GRAPH6_Y1=340,GRAPH6_Y2=440,
00128 };
00129 
00130 /*
00131 enum{
00132   GRAPH1_X1=50,GRAPH1_X2=190,
00133   GRAPH1_Y1=80,GRAPH1_Y2=180,
00134   GRAPH2_X1=50,GRAPH2_X2=190,
00135   GRAPH2_Y1=210,GRAPH2_Y2=310,
00136   GRAPH3_X1=50,GRAPH3_X2=190,
00137   GRAPH3_Y1=340,GRAPH3_Y2=440,
00138   GRAPH4_X1=610,GRAPH4_X2=750,
00139   GRAPH4_Y1=80,GRAPH4_Y2=180,
00140   GRAPH5_X1=610,GRAPH5_X2=750,
00141 GRAPH5_Y1=210,GRAPH5_Y2=310,
00142 GRAPH6_X1=610,GRAPH6_X2=750,
00143 GRAPH6_Y1=340,GRAPH6_Y2=440,
00144 };
00145 */
00146 
00147 enum {
00148     MIN_MAX_X1=GRAPH4_X1+120,
00149     MIN_MAX_Y1=GRAPH4_Y1-20,
00150     MIN_MAX_X2=GRAPH4_X1+135,
00151     MIN_MAX_Y2=GRAPH4_Y1-3
00152 };
00153 
00154 enum {                                            // formatFlag for date_str_ymd and date_str_julian
00155     INFO_DATE_NO_DAY       = 0x0001,                // don't display date. if day is 0 also suppress
00156     INFO_DATE_NO_MONTH     = 0x0010,                // don't display month. if month is 0 also suppress
00157     INFO_DATE_SHORT_MONTH  = 0x0020,                // short form month (Jan/Feb...)
00158     INFO_DATE_NO_YEAR      = 0x0100,                // don't display year. if month is 0 also suppress
00159     INFO_DATE_F_YEAR       = 0x0200,                // use financial year
00160     INFO_DATE_ADD_YR       = 0x0400,                // add Yr before year, eg. DD MONTH Yr.YY instead of DD MONTH, YY
00161 
00162 #if(GAME_VERSION>=200)
00163     INFO_DATE_DEFAULT = INFO_DATE_F_YEAR|INFO_DATE_ADD_YR
00164 #else
00165     INFO_DATE_DEFAULT = INFO_DATE_ADD_YR
00166 #endif
00167 };
00168 
00169 //----------- Define class Info ------------//
00170 
00171 class VgaBuf;
00172 
00176 class Info {
00177 public:
00178     int   game_start_date;                        // set to Game::game_start_year in Info::init(), the actual date the game begins, not the scenario begins
00179     int   game_date;                              // 0429 public for odynarrb.cpp
00180     int   game_day;
00181     int   game_month;
00182     int   game_year;
00183     int   prerun_year;                            //## chea added to count the pre-run year
00184     int financial_year();
00185 
00186     //#### begin fred 0911 ####//
00187     int   year_passed;                            // no. of years passed since playing
00188 
00189     // for statistics graph plotting
00190     int   graph_year_passed;                      // no. of years passed since playing
00191     int   graph_month_passed;                     // no. of years passed since playing
00192     int   graph_trimester_passed;                 // no. of years passed since playing
00193 
00194     // for projected statistics graph
00195     int graph_year;
00196     int graph_month;
00197     int graph_trimester;
00198     //#### end fred 0911 ####//
00199 
00200     unsigned long start_play_time;                // the time player start playing the game today
00201     unsigned long total_play_time;                // total time the player has played in all saved games
00202 
00203     long random_seed_4_save;                      //## chea 210899 to save the random seed before save
00204     int last_year_array[5];                       //## chea 150999 student no.last year
00205 
00206     float avg_tal_acd;                            //## chea 200100
00207     float avg_tal_ext;                            //## chea 200100
00208     float avg_tal_ath;                            //## chea 200100
00209 
00210 private:
00211     int   goal_deadline;
00212     short goal_difficulty;
00213     short goal_score_bonus;
00214 
00215     int   week_day;                               // = game_date&7
00216     int   year_day;                               // the nth day in a year
00217 
00218     int  random_seed;
00219 
00220     char  last_write_offset;                      // it is used for an offset locator for excluding static member vars during reading and writing files
00221 
00222     char* play_time_str();                        // return total time played in string
00223     char* game_duration_str();
00224 
00225     //---------------------------------//
00226 
00227     short *date_info_bitmap;
00228     short *year_info_bitmap;
00229 
00230     short *top_info_bitmap;
00231     short *bottom_info_bitmap;
00232     short *surplus_info_bitmap;
00233     short *score_info_bitmap;
00234     short *uscore_info_bitmap;
00235     short *more_report_bitmap;
00236     short *help_quest_bitmap;
00237     short *list_button_bitmap;
00238 
00239     short *top_left_column_bitmap;
00240     short *top_right_column_bitmap;
00241     short *bottom_left_column_bitmap;
00242     short *bottom_right_column_bitmap;
00243 
00244     ImageRes    date_res_bitmap;
00245 
00246 public:
00247     short *menu_down_bitmap, *menu_up_bitmap;
00248     char  *report_bitmap[REPORT_ITEMS + 1];
00249 
00250 public:
00251     Info();
00252     ~Info();
00253 
00254     void  init();
00255     void  deinit();
00256 
00257     int   write_file(File* filePtr);
00258     int read_file(File* filePtr);
00259 
00260     void  init_random_seed(int randomSeed);
00261 
00262     void  disp_panel_init();
00263 
00264     void  disp_column_bitmap(VgaBuf*);
00265 
00266     void  disp();
00267 
00268     void  next_day();
00269     bool  is_begin_trimester();
00270     void  disp_6_graphs();
00271     char  disp_6_graphs_flag;
00272 
00273     char* date_str_ymd( int year, int month, int day, int formatFlag=INFO_DATE_DEFAULT);
00274     char* date_str_julian( long julianDate, int formatFlag=INFO_DATE_DEFAULT);
00275 
00276 #if(GAME_VERSION>=200)
00277     void  update_distance_learning_variables(char initValue=0);
00278 #endif
00279 
00280 private:
00281     void  disp_selected_name();
00282     void  disp_calendar();
00283     void  new_trimester_course_enrollment();
00284     void  end_prerun_year();
00285     void  inc_game_day();
00286 };
00287 
00288 extern Info info;
00289 
00290 //------------------------------------------//
00291 #endif

Generated on Fri Aug 23 01:37:59 2002 for VirtualU by doxygen1.2.17