00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include "book2/book2-power-plant.hpp"
00026 #include "traveller-constants.hpp"
00027
00028 static driveRecord powerPlantTable[24]={
00029 {'A',4,MCR 8},
00030 {'B',7,MCR 12},
00031 {'C',10,MCR 16},
00032 {'D',13,MCR 20},
00033 {'E',16,MCR 24},
00034 {'F',19,MCR 28},
00035 {'G',22,MCR 32},
00036 {'H',25,MCR 36},
00037 {'J',28,MCR 40},
00038 {'K',31,MCR 44},
00039 {'L',34,MCR 48},
00040 {'M',37,MCR 52},
00041 {'N',40,MCR 56},
00042 {'P',43,MCR 60},
00043 {'Q',46,MCR 64},
00044 {'R',49,MCR 68},
00045 {'S',52,MCR 72},
00046 {'T',55,MCR 76},
00047 {'U',58,MCR 80},
00048 {'V',61,MCR 84},
00049 {'W',64,MCR 88},
00050 {'X',67,MCR 92},
00051 {'Y',70,MCR 96},
00052 {'Z',73,MCR 100},
00053 };
00054
00055
00056 book2PowerPlant::book2PowerPlant() : book2DriveObject(){
00057 }
00058
00059 book2PowerPlant::book2PowerPlant(char m) : book2DriveObject(){
00060 this->setModel(m);
00061 }
00062
00063 void book2PowerPlant::setModel (char m){
00064 int set =0;
00065 int ix;
00066
00067 for(ix=0;ix<24;ix++){
00068 if ( powerPlantTable[ix].model == m ) {
00069 this->setCost(powerPlantTable[ix].cost);
00070 this->setMass(powerPlantTable[ix].mass);
00071 set=1;
00072 }
00073 }
00074 if ( set == 1 )
00075 this->book2DriveObject::setModel(m);
00076 else
00077 this->book2DriveObject::setModel('?');
00078
00079 }
00080
00081