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

Password:

NewsArray class Reference
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

NewsArray Class Reference

#include <Onews.h>

Inheritance diagram for NewsArray:

DynArray List of all members.

Public Methods

 NewsArray ()
void init ()
void deinit ()
int write_file (File *filePtr)
int read_file (File *filePtr)
void enable ()
void disable ()
void reset ()
void default_setting ()
void clear_news_disp ()
Newsadd_news (int newsId, int newsType=NEWS_NORMAL)
void remove (int newsId, int shortPara1)
void alumni_die (int gender, int bequest)
void rape_in_campus ()
void retrofit_facilities (int dollarLost)
void earth_quake ()
void risky_research (int moneyLost)
void scandal_in_athletics ()
void research_prize (int deptRecno, int facultyRecno)
void technology_transfer (int deptRecno, float transferAmount)
void capital_campaign ()
void student_loans (int is_increase)
void plagiarism_scandal (int dismissedStudCount)
void for_profit_competition ()
void minority_student_percentage_falls ()
void successful_grad ()
void media_obtain_information (float trueCostEducation)
void congress_research (char direction)
void stock_market (char direction)
void scandalous_fund_use (int dollarLost)
void new_governor (char direction)
void court_limit_minority ()
void new_year_start ()
void scenario_near_end ()
void scenario_news (char type, char subType=0, int year=0)
void football_game (int numWins)
void basketball_game (int numWins)
void open_game_near_end ()
void open_game_end ()
void new_task (News *taskPtr, char subtype=TASK_STARTED)
Newsoperator[] (int recNo)

Public Attributes

char news_type_option [NEWS_TYPE_NUM]
char news_who_option
char news_add_flag
int last_clear_recno

Detailed Description

Collection class of all possible news events that have occurred during the history of the game. Also defines interface for generating new news events.

Definition at line 259 of file Onews.h.


Constructor & Destructor Documentation

NewsArray::NewsArray  
 

Definition at line 16 of file ONEWS.CPP.


Member Function Documentation

News * NewsArray::add_news int    newsId,
int    newsType = NEWS_NORMAL
 

Called by news processing function to set news parameters

<int> newsId = the id. of the news <int> newsType = news type [int] nationRecno = nation recno of the news [int] nationRecno2 = recno of the 2nd nation related to the news [int] forceAdd = add this news anyway, regardless of whether the nation has contact with the player or not (default: 0)

return : <News*> return the pointer of the News NULL - the nation of the news does not have contact with the player

Definition at line 680 of file Onewsadd.cpp.

References MAX_NEWS.

Referenced by capital_campaign(), research_prize(), student_loans(), and technology_transfer().

void NewsArray::alumni_die int    gender,
int    bequest
 

<int> gender = { GENDER_MALE, GENDER_FEMALE }; <int> bequest = dollar in million

short_para1 = the recno of the TalkMsg in talk_res.talk_msg_array

Definition at line 27 of file Onewsadd.cpp.

References NEWS_ALUMNI_DIE.

void NewsArray::basketball_game int    numWins
 

<int>

Definition at line 484 of file Onewsadd.cpp.

References INPUT_LOW, and NEWS_BASKETBALL_GAME.

void NewsArray::capital_campaign  
 

Definition at line 259 of file Onewsadd.cpp.

References add_news(), and NEWS_CAPITAL_CAMPAIGN.

void NewsArray::clear_news_disp  
 

void NewsArray::congress_research char    dir
 

short_para1 = adjust direction

Definition at line 90 of file Onewsadd.cpp.

References NEWS_CONGRESS_RESEARCH.

void NewsArray::court_limit_minority  
 

Definition at line 327 of file Onewsadd.cpp.

References NEWS_COURT_LIMIT_MINORITY.

void NewsArray::default_setting  
 

Reset all news display options

Definition at line 56 of file ONEWS.CPP.

References NEWS_DISP_ALL, and NEWS_NORMAL.

void NewsArray::deinit  
 

Reimplemented from DynArray.

Definition at line 31 of file ONEWS.CPP.

void NewsArray::disable   [inline]
 

Definition at line 281 of file Onews.h.

References news_add_flag.

void NewsArray::earth_quake  
 

<int>

Definition at line 77 of file Onewsadd.cpp.

References NEWS_EARTH_QUAKE.

void NewsArray::enable   [inline]
 

Definition at line 280 of file Onews.h.

References news_add_flag.

void NewsArray::football_game int    numWins
 

<int>

Definition at line 402 of file Onewsadd.cpp.

References INPUT_LOW, and NEWS_FOOTBALL_GAME.

void NewsArray::for_profit_competition  
 

short_para1 = inc //in operation reserve.

Definition at line 156 of file Onewsadd.cpp.

References NEWS_FOR_PROFIT_COMPETITION.

void NewsArray::init  
 

Definition at line 23 of file ONEWS.CPP.

void NewsArray::media_obtain_information float    trueCostEducation
 

short_para1 = true cost education

Definition at line 204 of file Onewsadd.cpp.

References NEWS_MEDIA_OBTAIN_INFORMATION.

void NewsArray::minority_student_percentage_falls  
 

short_para1 = inc //in operation reserve.

Definition at line 172 of file Onewsadd.cpp.

References NEWS_MINORITY_STUDENT_PERCENTAGE_FALLS.

void NewsArray::new_governor char    direction
 

short_para1 = direction

Definition at line 314 of file Onewsadd.cpp.

References NEWS_NEW_GOVENOR.

void NewsArray::new_task News   taskPtr,
char    subtype = TASK_STARTED
 

<int> taskPtr - task info [int] subtype=TASK_STARTED by default

Definition at line 560 of file Onewsadd.cpp.

References NEWS_NEW_TASK, and NEWS_NORMAL.

void NewsArray::new_year_start  
 

<int>

Definition at line 580 of file Onewsadd.cpp.

References NEWS_NEW_YEAR_START, and NEWS_NORMAL.

void NewsArray::open_game_end  
 

Definition at line 626 of file Onewsadd.cpp.

References NEWS_NORMAL, and NEWS_OPEN_GAME_END.

void NewsArray::open_game_near_end  
 

Definition at line 604 of file Onewsadd.cpp.

References NEWS_NORMAL, and NEWS_OPEN_GAME_NEAR_END.

News * NewsArray::operator[] int    recNo
 

Definition at line 96 of file ONEWS.CPP.

References err_if, err_now, DynArray::get(), News::news_date, and NULL.

void NewsArray::plagiarism_scandal int    dismissedStudCount
 

short_para1 = number of dismissed students.

Definition at line 139 of file Onewsadd.cpp.

References NEWS_PLAGIARISM_SCANDAL.

void NewsArray::rape_in_campus  
 

<int>

Definition at line 47 of file Onewsadd.cpp.

References NEWS_RAPE_IN_CAMPUS.

int NewsArray::read_file File   filePtr
 

Read a saved dynamic array from file, it must be saved with write_file()

<File*> readFile = the pointer to the writing file

Return : 1 - read successfully 0 - writing error

Reimplemented from DynArray.

Definition at line 346 of file OGFILE3.CPP.

References File::file_read(), and DynArray::read_file().

void NewsArray::remove int    newsId,
int    shortPara1
 

Remove a specific news from the news_array.

<int> newsId = id. of the news <int> shortPara1 = short_para1 of the news

Definition at line 71 of file ONEWS.CPP.

void NewsArray::research_prize int    deptRecno,
int    facultyRecno
 

Definition at line 221 of file Onewsadd.cpp.

References add_news(), Department::faculty_array, Faculty::first_name_id, Faculty::last_name_id, Faculty::middle_name_id, NEWS_RESEARCH_PRIZE, News::short_para1, News::short_para2, News::short_para3, News::short_para4, and News::short_para5.

void NewsArray::reset  
 

Reset all news display options and clear all news in the log

Definition at line 41 of file ONEWS.CPP.

void NewsArray::retrofit_facilities int    dollarLost
 

<int> short_para1 = dollarLost;

Definition at line 60 of file Onewsadd.cpp.

References NEWS_RETROFIT_FACILITIES.

void NewsArray::risky_research int    moneyLost
 

short_para1 = inc //in operation reserve.

Definition at line 106 of file Onewsadd.cpp.

References NEWS_RISKY_RESEARCH.

void NewsArray::scandal_in_athletics  
 

short_para1 = inc //in operation reserve.

Definition at line 123 of file Onewsadd.cpp.

References NEWS_SCANDAL_IN_ATHLETICS.

void NewsArray::scandalous_fund_use int    dollarLost
 

short_para1 = dollarLost

Definition at line 299 of file Onewsadd.cpp.

References NEWS_SCANDALOUS_FUND_USE.

void NewsArray::scenario_near_end  
 

<int>

Definition at line 593 of file Onewsadd.cpp.

References NEWS_NORMAL, and NEWS_SCENARIO_NEAR_END.

void NewsArray::scenario_news char    type,
char    subType = 0,
int    year = 0
 

<int>

Definition at line 650 of file Onewsadd.cpp.

References NEWS_NORMAL, and NEWS_SCENARIO_NEWS.

void NewsArray::stock_market char    dir
 

short_para1 = adjust direction

Definition at line 284 of file Onewsadd.cpp.

References NEWS_STOCK_MARKET.

void NewsArray::student_loans int    is_increase
 

Definition at line 269 of file Onewsadd.cpp.

References add_news(), NEWS_STUDENT_LOANS, and News::short_para1.

void NewsArray::successful_grad  
 

short_para1 = inc //in operation reserve.

Definition at line 188 of file Onewsadd.cpp.

References NEWS_SUCCESSFUL_GRAD.

void NewsArray::technology_transfer int    deptRecno,
float    transferAmount
 

Definition at line 246 of file Onewsadd.cpp.

References add_news(), News::float_para1, NEWS_TECHNOLOGY_TRANSFER, and News::short_para1.

int NewsArray::write_file File   filePtr
 

Write current dynamic array into file, read_file() can be used to retrieve it.

<File*> writeFile = the pointer to the writing file

Return : 1 - write successfully 0 - writing error

Reimplemented from DynArray.

Definition at line 337 of file OGFILE3.CPP.

References File::file_write(), and DynArray::write_file().


Member Data Documentation

int NewsArray::last_clear_recno
 

Definition at line 267 of file Onews.h.

char NewsArray::news_add_flag
 

Definition at line 265 of file Onews.h.

Referenced by disable(), and enable().

char NewsArray::news_type_option[NEWS_TYPE_NUM]
 

Definition at line 263 of file Onews.h.

char NewsArray::news_who_option
 

Definition at line 264 of file Onews.h.


The documentation for this class was generated from the following files:
Generated on Fri Aug 23 01:39:26 2002 for VirtualU by doxygen1.2.17