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) |
book2ShipHull::book2ShipHull | ( | ) |
book2ShipHull::book2ShipHull | ( | int | ix | ) |
Alternate constructor. Constructs a hull from a standard hull
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.
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:
double book2ShipHull::getCost | ( | ) |
get the base cost of this hull
Definition at line 121 of file book2-ship-hull.cpp.
double book2ShipHull::getDriveCompartment | ( | ) |
get the size of the drive compartment
Definition at line 113 of file book2-ship-hull.cpp.
Referenced by book2Ship::addDrives().
Here is the caller graph for this function:
typeHull book2ShipHull::getHullType | ( | ) |
Return the type of hull we are using.
Definition at line 129 of file book2-ship-hull.cpp.
double book2ShipHull::getMainCompartment | ( | ) |
get the size of the main compartment
Definition at line 105 of file book2-ship-hull.cpp.
Referenced by book2Ship::addDrives().
Here is the caller graph for this function:
void book2ShipHull::isStreamlined | ( | int | s | ) |
Make it streamlined!
s | non-zero to be considered streamlined, 0 if not. |
Definition at line 133 of file book2-ship-hull.cpp.
int book2ShipHull::isStreamlined | ( | ) |
Is this streamlined?
Definition at line 137 of file book2-ship-hull.cpp.
void book2ShipHull::setCost | ( | double | c | ) |
set the base cost of this hull
c | double value representing the value of this hull |
Definition at line 117 of file book2-ship-hull.cpp.
Referenced by book2ShipHull().
Here is the caller graph for this function:
void book2ShipHull::setDriveCompartment | ( | double | s | ) |
set the size of the drive compartment
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().
Here is the caller graph for this function:
void book2ShipHull::setHullType | ( | typeHull | t | ) |
Set the type of hull we are using
t | enumrated value of type typeHull (either custom or standard) |
Definition at line 125 of file book2-ship-hull.cpp.
Referenced by book2ShipHull().
Here is the caller graph for this function:
void book2ShipHull::setMainCompartment | ( | double | s | ) |
set the size of the main compartment
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().
Here is the caller graph for this function:
void book2ShipHull::setSize | ( | double | s | ) |
set the hull size
s | double value to set the hull size to. |
Definition at line 93 of file book2-ship-hull.cpp.
Referenced by book2ShipHull().
Here is the caller graph for this function: