book2ShipHull Class Reference

List of all members.

Detailed Description

Definition at line 45 of file book2-ship-hull.hpp.

Public Member Functions

 book2ShipHull ()
 book2ShipHull (int ix)
 book2ShipHull (double m, double d)
typeHull getHullType ()
void setHullType (typeHull t)
double getSize ()
void setSize (double s)
double getMainCompartment ()
void setMainCompartment (double s)
double getDriveCompartment ()
void setDriveCompartment (double s)
double getCost ()
void setCost (double c)
int isStreamlined ()
void isStreamlined (int s)


Constructor & Destructor Documentation

book2ShipHull::book2ShipHull (  ) 

Constructor

Definition at line 48 of file book2-ship-hull.cpp.

00048                             {
00049 }

book2ShipHull::book2ShipHull ( int  ix  ) 

Alternate constructor. Constructs a hull from a standard hull

Parameters:
ix integer index for standard hull type.

Definition at line 51 of file book2-ship-hull.cpp.

References standardHullRecord::cost, standardHullRecord::driveTonnage, standardHullRecord::mainTonnage, setCost(), setDriveCompartment(), setHullType(), setMainCompartment(), setSize(), and standardHullRecord::tonnage.

00051                                   {
00052         if ( ix < 0 ) ix=0;
00053         if ( ix > 5 ) ix=5;
00054         
00055         standardHullRecord standardHull = standardHulls[ix];
00056         
00057         this->setSize(standardHull.tonnage);
00058         this->setMainCompartment(standardHull.mainTonnage);
00059         this->setDriveCompartment(standardHull.driveTonnage);
00060         this->setCost(standardHull.cost);
00061         this->setHullType(standard);
00062         
00063 }

Here is the call graph for this function:

book2ShipHull::book2ShipHull ( double  m,
double  d 
)

Constructor take 3. Two parameters are passed, one for the main compartment size and the other for the drive compartment. The two are summed to determine the hull's full size. Full size must fall on even 100 boundary and must not be greater than 5000, adjustments will be hueristically made accordingly.

Parameters:
m double value representing the size of the main compartment.
d double value representing the size of the drive compartment.

We need to revisit this later, this could produce some rather bizarre results and needs to have more intelligence applied to it.

Definition at line 65 of file book2-ship-hull.cpp.

References setCost(), setDriveCompartment(), setHullType(), setMainCompartment(), and setSize().

00065                                              {
00066         double total = m + d; 
00067         double hullCost =0;
00068         
00069         int    check; 
00070         
00071         check = (int)( total/100 );
00072         check = ( check > 5000 ? 5000 : check);
00078         if ( (check * 100) != (int) total) {
00079                 total = (double) check; 
00080                 m = total - d;
00081         }
00082 
00083         this->setSize(total);
00084         this->setMainCompartment(m);
00085         this->setDriveCompartment(d);
00086         
00087         hullCost = MCR 0.1 * total;
00088         this->setCost(hullCost);
00089         this->setHullType(custom);
00090         
00091 }

Here is the call graph for this function:


Member Function Documentation

double book2ShipHull::getCost (  ) 

get the base cost of this hull

Returns:
double value representing the base cost of the hull

Definition at line 121 of file book2-ship-hull.cpp.

00121                              {
00122         return cost;
00123 }

double book2ShipHull::getDriveCompartment (  ) 

get the size of the drive compartment

Returns:
double value representing the size of the drive compartment.

Definition at line 113 of file book2-ship-hull.cpp.

Referenced by book2Ship::addDrives().

00113                                          {
00114         return driveCompartment;
00115 }

Here is the caller graph for this function:

typeHull book2ShipHull::getHullType (  ) 

Return the type of hull we are using.

Returns:
enumerated typeHull value.

Definition at line 129 of file book2-ship-hull.cpp.

00129                                     {
00130         return hullType;
00131 }

double book2ShipHull::getMainCompartment (  ) 

get the size of the main compartment

Returns:
double value representing the size of the main compartment.

Definition at line 105 of file book2-ship-hull.cpp.

Referenced by book2Ship::addDrives().

00105                                         {
00106         return mainCompartment;
00107 }

Here is the caller graph for this function:

void book2ShipHull::isStreamlined ( int  s  ) 

Make it streamlined!

Parameters:
s non-zero to be considered streamlined, 0 if not.

Definition at line 133 of file book2-ship-hull.cpp.

00133                                        {
00134         streamlined = ( s==0? 0: 1);
00135 }

int book2ShipHull::isStreamlined (  ) 

Is this streamlined?

Returns:
1 if this is streamlined 0 if not

Definition at line 137 of file book2-ship-hull.cpp.

00137                                    {
00138         return streamlined;
00139 }

void book2ShipHull::setCost ( double  c  ) 

set the base cost of this hull

Parameters:
c double value representing the value of this hull

Definition at line 117 of file book2-ship-hull.cpp.

Referenced by book2ShipHull().

00117                                    {
00118         cost =c;
00119 }

Here is the caller graph for this function:

void book2ShipHull::setDriveCompartment ( double  s  ) 

set the size of the drive compartment

Parameters:
s double value to set the drive compartment size to

Definition at line 109 of file book2-ship-hull.cpp.

Referenced by book2Ship::addDrives(), and book2ShipHull().

00109                                                {
00110         driveCompartment=s;
00111 }

Here is the caller graph for this function:

void book2ShipHull::setHullType ( typeHull  t  ) 

Set the type of hull we are using

Parameters:
t enumrated value of type typeHull (either custom or standard)

Definition at line 125 of file book2-ship-hull.cpp.

Referenced by book2ShipHull().

00125                                           {
00126         hullType=t;
00127 }

Here is the caller graph for this function:

void book2ShipHull::setMainCompartment ( double  s  ) 

set the size of the main compartment

Parameters:
s double value to set the main compartment size to.

Definition at line 101 of file book2-ship-hull.cpp.

Referenced by book2Ship::addDrives(), and book2ShipHull().

00101                                               {
00102         mainCompartment =s;
00103 }

Here is the caller graph for this function:

void book2ShipHull::setSize ( double  s  ) 

set the hull size

Parameters:
s double value to set the hull size to.

Definition at line 93 of file book2-ship-hull.cpp.

Referenced by book2ShipHull().

00093                                    {
00094         size=s;
00095 }

Here is the caller graph for this function:


The documentation for this class was generated from the following files:
Generated on Fri Mar 7 16:41:26 2008 for frpuniverse by  doxygen 1.4.7