src/book2/book2-power-plant.cpp

00001 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
00002 /*
00003  * frpuniverse
00004  * Copyright (C) Peter L. Berghold 2008 <peter@berghold.net>
00005  * 
00006  * frpuniverse is free software.
00007  * 
00008  * You may redistribute it and/or modify it under the terms of the
00009  * GNU General Public License, as published by the Free Software
00010  * Foundation; either version 2 of the License, or (at your option)
00011  * any later version.
00012  * 
00013  * frpuniverse is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00016  * See the GNU General Public License for more details.
00017  * 
00018  * You should have received a copy of the GNU General Public License
00019  * along with frpuniverse.  If not, write to:
00020  *      The Free Software Foundation, Inc.,
00021  *      51 Franklin Street, Fifth Floor
00022  *      Boston, MA  02110-1301, USA.
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 

Generated on Fri Mar 7 16:40:53 2008 for frpuniverse by  doxygen 1.4.7