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

Password:

OTASK.H Source File
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

OTASK.H

Go to the documentation of this file.
00001 //Filename    : OTASK.H
00002 //Description : Object News
00003 //Owner           : Fred
00004 
00005 //------------------------------------//
00006 //
00007 // Task array/list properties (for each task):
00008 //
00009 // - shown on both message (normal news) and objective sections on screen
00010 // - will be removed from the objective section after the task offer expires or the task is completed
00011 // - checked monthly the success of the task; add bonus if task is completed
00012 //
00013 //------------------------------------//
00014 
00015 #ifndef __OTASK_H
00016 #define __OTASK_H
00017 
00018 #include <ONEWS.H>
00019 
00020 //--------- Define constant --------------//
00021 
00022 //#define DISP_TASKS_COUNT 5                    // maximum no. of task message displayed on the screen at a time
00023 
00024 //#define TASKS_STR_PARA_LEN 20
00025 
00026 //-------- Define task type ---------//
00027 
00028 enum { TASK_WHO_NUM=1 };
00029 enum {                                            //, TASKS_DISP_FRIENDLY, TASKS_DISP_PLAYER, TASKS_DISP_NONE };
00030     TASK_DISP_ALL=0
00031 };
00032 
00033 //------- Define other constant -------//
00034 
00035 //--------- Define task id. ----------//
00036 
00037 #define TASK_COUNT 8                              //## chea 220999 1 is org. & is the first ele
00038 enum {
00039     TASK_RISE_PERFORMANCE_RATING = 1,               // rise value of performance indicator
00040     RISE_EDUCATIONAL_QUALITY,                       //## chea 220999
00041     RISE_STUDENT_MORALE,
00042     RISE_DEPARTMENT_MORALE,
00043     RISE_FACULTY_RESEARCH,
00044     RISE_FACULTY_DIVERSITY_INDEX,
00045     RISE_USE_OF_IT,
00046     RISE_STAFF_MORALE,
00047 };
00048 
00049 //------------------------------------//
00050 // typedef News Task;
00051 
00057 struct Task : News {
00058     //bool (*complete_func)();
00059     //bool (*expiry_func)();
00060 
00061     // temp functions for each task type
00062     bool  is_completed_rise_performance();
00063     bool  is_completed_rise_educational_quality();  //## chea 220999
00064     bool  is_completed_rise_student_morale();
00065     bool  is_completed_rise_department_morale();
00066     bool  is_completed_rise_faculty_research_Per();
00067     bool  is_completed_rise_faculty_diversity_index();
00068     bool  is_completed_rise_use_of_IT();
00069     bool  is_completed_rise_staff_morale();
00070 
00071     // functions for all task types
00072     bool  is_expired();
00073     void  set_completed();
00074 };
00075 
00076 //-------- Define class TaskArray ----------//
00077 
00080 class TaskArray : public DynArray {
00081 public:
00082     //------ display options ------//
00083 
00084     char  task_who_option;
00085     char  task_add_flag;
00086     int total_bonus_pt;
00087 
00088     float rand_init;
00089 
00090 public:
00091     TaskArray();
00092 
00093     void  init();                                 // called in ogame.cpp
00094     void  deinit();                               // called in ogame.cpp
00095 
00096     int write_file(File* filePtr);
00097     int read_file(File* filePtr);
00098 
00099     void  enable()        { task_add_flag = 1; }
00100     void  disable()   { task_add_flag = 0; }
00101 
00102     void  reset();
00103     void  default_setting();
00104 
00105     void  clear_task_disp();
00106 
00107     void  next_day();
00108     Task* add_task(int taskId);
00109     void  remove(int index);
00110     bool  can_add_more_task();
00111 
00112     //------ functions for adding task -------//
00113 
00114     void  rise_performance_rating(int deptRecno, int ratingType,
00115                                   int target, int src, int month, int year, int bonus);
00116 
00117     void  rise_educational_quality(int deptRecno, int ratingType,
00118                                    int target, int src, int month, int year, int bonus);
00119 
00120     void  rise_student_morale(int deptRecno, int ratingType,
00121                               int target, int src, int month, int year, int bonus);
00122 
00123     void  rise_department_morale(int deptRecno, int ratingType,
00124                                  int target, int src, int month, int year, int bonus);
00125 
00126     void  rise_faculty_research_Per(int deptRecno, int ratingType,
00127                                     int target, int src, int month, int year, int bonus);
00128 
00129     void  rise_faculty_diversity_index(int deptRecno, int ratingType,
00130                                        int target, int src, int month, int year, int bonus);
00131 
00132     void  rise_use_of_IT(int deptRecno, int ratingType,
00133                          int target, int src, int month, int year, int bonus);
00134 
00135     void  rise_staff_morale(int deptRecno, int ratingType,
00136                             int target, int src, int month, int year, int bonus);
00137 
00138     //--------------------------------------------//
00139 
00140     Task* operator[](int recNo);
00141 };
00142 
00143 extern TaskArray task_array;
00144 
00145 //-------------------------------------------//
00146 #endif

Generated on Fri Aug 23 01:38:30 2002 for VirtualU by doxygen1.2.17