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

Password:

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

OFIELD.H

Go to the documentation of this file.
00001 //Filename    : OFIELD.H
00002 //Description : Field Class Declaration
00003 
00004 #ifndef __OFIELD_H
00005 #define __OFIELD_H
00006 
00007 #ifndef __OCOURSE_H
00008 #include <OCOURSE.H>
00009 #endif
00010 
00011 //--------- Define IPED fields ---------//
00012 
00013 enum { IPED_FIELD_COUNT = 14 };
00014 //TO SORT this according to student_par spreadsheet
00015 enum {
00016     AGRICULTURE,
00017     BASIC_PERSONAL_PRACTICAL_SVCS,
00018     BUSINESS,
00019     COMMUNICAIONS_LIBRARY_SCI,
00020     EDUCATION,
00021     ENGINEERING,
00022     FOREIGN_LANGUAGES,
00023     HEALTH_SOCIAL_SVCS,
00024     HUMANITIES,
00025     INTER_DISCIPLINARY,
00026     LIFE_PHYSICAL_SCI,
00027     MATH_COMP_SCI,
00028     SOCIAL_SCIENCES,
00029     VISUAL_PERFORMING_ARTS
00030 };
00031 
00032 //--------- Define fields used in the game ------//
00033 
00034 enum { GAME_FIELD_COUNT = 9 };
00035 
00036 enum {
00037     FIELD_APPLIED_SCIENCE=1,
00038     FIELD_BUSINESS,
00039     FIELD_CREATIVE_ARTS,
00040     FIELD_ENGINEERING,
00041     FIELD_HUMANITIES,
00042     FIELD_LANGUAGE_STUDIES,
00043     FIELD_MATH_AND_COMPUTER_SCIENCE,
00044     FIELD_NATURAL_SCIENCE,
00045     FIELD_SOCIAL_SCIENCE,
00046 };
00047 
00048 //------ Define struct FieldRec -------//
00049 
00052 struct FieldRec {
00053     enum { NAME_LEN=30 };
00054 
00055     char  code;
00056     char  name[NAME_LEN];
00057 
00058     char  elective_course_focus_pref[MAX_COURSE_DEPTH_WITHOUT_GR][2];
00059 };
00060 
00061 //----- Define struct FieldInfo -------//
00062 
00065 struct FieldInfo {
00066     enum { NAME_LEN=30 };
00067 
00068     char  code;
00069     char  name[NAME_LEN+1];
00070 
00071     // the total of preference weight across different focus categories is 100
00072     short elective_course_focus_pref[MAX_COURSE_DEPTH_WITHOUT_GR];
00073 };
00074 
00075 //----------- Define class FieldRes ---------------//
00076 
00078 class FieldRes {
00079 public:
00080     char            init_flag;
00081 
00082     short           field_count;
00083     FieldInfo*      info_array;
00084 
00085 public:
00086     FieldRes();
00087 
00088     void        init();
00089     void        deinit();
00090 
00091     int       look_up_code(int fieldCode);
00092 
00093     int         write_file(File*);
00094     int         read_file(File*);
00095 
00096 #ifdef DEBUG
00097     FieldInfo*   operator[](int fieldId);
00098 #else
00099     FieldInfo*   operator[](int fieldId) { return info_array + fieldId - 1; }
00100 #endif
00101 
00102 private:
00103     void        load_info();
00104 };
00105 
00106 extern FieldRes field_res;
00107 
00108 //---------------------------------------------//
00109 #endif

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