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

Password:

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

FirmArray Class Reference

#include <OFIRMA.H>

Inheritance diagram for FirmArray:

DynArrayB DynArray List of all members.

Public Methods

 FirmArray ()
 ~FirmArray ()
void init ()
void deinit ()
int add_firm (int xLoc, int yLoc, int firmId)
int create_firm (int firmId)
void select_firm (int firmRecno)
void del_firm (int)
int firm_class_size (int)
int process ()
void next_day ()
void next_month ()
void next_year ()
void skip (int)
int write_file (File *)
int read_file (File *)
Firmoperator() ()
Firmoperator[] (int recNo)
int is_deleted (int recNo)

Public Attributes

int selected_recno
int touched_recno
int touched_frame_count

Detailed Description

Collection Class for managing all of the visible buildings. Responds to click events by playing associated sound effect, and processes all firms for action and movement for next frame.

Definition at line 19 of file OFIRMA.H.


Constructor & Destructor Documentation

FirmArray::FirmArray  
 

desc <int> - [int] -

Definition at line 17 of file OFIRMA.CPP.

FirmArray::~FirmArray  
 

Definition at line 25 of file OFIRMA.CPP.


Member Function Documentation

int FirmArray::add_firm int    xLoc,
int    yLoc,
int    firmId
 

<int> xLoc = the x location of the firm to be built <int> yLoc = the y location of the firm to be built <int> firmId = firm type id.

Return : <int> the record no. of the newly added firm; index for firm_array

Definition at line 83 of file OFIRMA.CPP.

int FirmArray::create_firm int    firmId
 

called by :

1. FirmArray::add_firm() for setting up a new firm 2. FirmArray::read_file() when loading game.

<int> firmId = firm type id

return : <int> the record no. of the newly added firm

Definition at line 111 of file OFIRMA.CPP.

void FirmArray::deinit  
 

Reimplemented from DynArray.

Definition at line 42 of file OFIRMA.CPP.

void FirmArray::del_firm int   
 

Definition at line 136 of file OFIRMA.CPP.

References DynArrayB::linkout(), selected_recno, and touched_recno.

int FirmArray::firm_class_size int   
 

void FirmArray::init  
 

Definition at line 33 of file OFIRMA.CPP.

int FirmArray::is_deleted int    recNo [inline]
 

Definition at line 58 of file OFIRMA.H.

References DynArray::get_ptr(), and NULL.

void FirmArray::next_day  
 

void FirmArray::next_month  
 

void FirmArray::next_year  
 

Firm* FirmArray::operator()   [inline]
 

Definition at line 54 of file OFIRMA.H.

References DynArray::get_ptr().

Firm* FirmArray::operator[] int    recNo [inline]
 

Definition at line 55 of file OFIRMA.H.

References DynArray::get_ptr().

Referenced by select_firm().

int FirmArray::process  
 

Process all firm in firm_array for action and movement for next frame

Return : 1 - all firm in the FirmArray has been processed 0 - only some has been processed, not all

Definition at line 69 of file OFIRMA.CPP.

int FirmArray::read_file File  
 

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 DynArrayB.

void FirmArray::select_firm int    firmRecno
 

Definition at line 158 of file OFIRMA.CPP.

References Firm::department_recno, FIRM_ADMISSIONS, FIRM_DEVELOPMENT, FIRM_FACILITIES, Firm::firm_id, FIRM_INDOOR_SPORTS, FIRM_LIBRARY, FIRM_OLD_MAIN, FIRM_PARK_LOTS, FIRM_PARK_STRUCTURE, FIRM_POLICE, FIRM_STADIUM, operator[](), and selected_recno.

void FirmArray::skip int   
 

int FirmArray::write_file File  
 

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 DynArrayB.


Member Data Documentation

int FirmArray::selected_recno
 

Definition at line 21 of file OFIRMA.H.

Referenced by del_firm(), and select_firm().

int FirmArray::touched_frame_count
 

Definition at line 24 of file OFIRMA.H.

int FirmArray::touched_recno
 

Definition at line 23 of file OFIRMA.H.

Referenced by del_firm().


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