00001
00002
00003
00004
00005 #include <ALL.H>
00006 #include <ODEPT.H>
00007 #include <ODEPTRES.H>
00008 #include <ODEPTGEN.H>
00009
00010
00012
00013 init();
00014 }
00015
00016
00017
00018
00020
00021
00022 err_when(student_array.student_count != 0);
00023
00024 student_array.zap();
00025
00026
00027 department_id = 0;
00028
00029
00030 memset(project_array, 0, sizeof(project_array));
00031 project_count = 0;
00032 project_added_this_year = false;
00033
00034 }
00035
00036
00037
00038
00040
00041 student_array.next_day();
00042 }
00043
00044
00045
00046
00051
00052 newSF = 0;
00053 expense = 0;
00054
00055 for( int i=project_count-1 ; i>=0 ; i-- ) {
00056 if( --(project_array[i].month_left) <= 0 ) {
00057 newSF += project_array[i].new_sf;
00058 expense += project_array[i].expense;
00059
00060 m.del_array_rec(project_array, project_count, sizeof(project_array[0]), i+1 );
00061 project_count--;
00062 }
00063 }
00064 }
00065
00066
00067
00068
00077
00078 err_when( newSF <= 0 || expense <=0 );
00079
00080 project_array[project_count].new_sf = newSF;
00081 project_array[project_count].expense = expense;
00082
00083 #if(GAME_VERSION>=200)
00084 project_array[project_count].month_left = 12;
00085 #else
00086 if ( !project_added_this_year )
00087 project_array[project_count].month_left = department_res[department_id]->months_to_construct;
00088 else
00089 project_array[project_count].month_left = 0;
00090 #endif
00091
00092 project_count++;
00093 err_when(project_count > MAX_PROJECT_COUNT);
00094
00095 project_added_this_year = true;
00096 }
00097
00098
00099
00100
00104
00105
00106
00107
00108
00109 }
00110
00111
00112
00113
00115
00116 int total = 0;
00117
00118 for ( int i=0; i<project_count; i++) {
00119 total += project_array[i].new_sf;
00120 }
00121
00122 return total;
00123 }
00124
00125
00126
00127
00136
00137 DepartmentInfo* thisDeptInfo = department_res[department_id];
00138
00139 int targetDeptId = department_array[targetDeptRecno]->department_id;
00140
00141
00142 int targetFieldId=0;
00143
00144 if( targetDeptId > 0 )
00145 targetFieldId = department_res[targetDeptId]->field_id;
00146
00147 if( targetDeptId == department_id )
00148 targetFieldId = 0;
00149
00150
00151
00152 switch( studentLevel ) {
00153 case UG_TRADITION:
00154 case UG_NONTRADITION:
00155 case DISTANCE_LEARN: {
00156 switch(courseDepth) {
00157 case DEPTH_D1:
00158
00159 return thisDeptInfo->bachelor_depth1[targetFieldId];
00160
00161 case DEPTH_D2:
00162 return thisDeptInfo->bachelor_depth2[targetFieldId];
00163
00164 case DEPTH_D3:
00165 return thisDeptInfo->bachelor_depth3[targetFieldId];
00166 }
00167 break;
00168 }
00169
00170 case MASTER: {
00171 switch(courseDepth) {
00172 case DEPTH_D3:
00173 return thisDeptInfo->master_depth3[targetFieldId];
00174
00175 case DEPTH_GR:
00176 return thisDeptInfo->master_graduate[targetFieldId];
00177 }
00178 break;
00179 }
00180
00181 case DOCTOR:
00182 return thisDeptInfo->doctor_graduate[targetFieldId];
00183 break;
00184 }
00185
00186 err_here();
00187 return 0;
00188 }
00189
00190