Back to index

fet  5.18.0
building.cpp
Go to the documentation of this file.
00001 //
00002 //
00003 // Description: This file is part of FET
00004 //
00005 //
00006 // Author: Liviu Lalescu <Please see http://lalescu.ro/liviu/ for details about contacting Liviu Lalescu (in particular, you can find here the e-mail address)>
00007 // Copyright (C) 2005 Liviu Lalescu <http://lalescu.ro/liviu/>
00008 //
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #include "building.h"
00019 #include "rules.h"
00020 
00021 Building::Building()
00022 {
00023 }
00024 
00025 Building::~Building()
00026 {
00027 }
00028 
00029 void Building::computeInternalStructure(Rules& r)
00030 {
00031        Q_UNUSED(r);
00032 }
00033 
00034 /*
00035 QString Building::getDescription()
00036 {
00037        QString s=tr("N:%1", "Name of the building").arg(this->name);
00038 
00039        return s;
00040 }*/
00041 
00042 QString Building::getDetailedDescription()
00043 {
00044        QString s=tr("Building");
00045        s+="\n";
00046        s+=tr("Name=%1", "The name of the building").arg(this->name);
00047        s+="\n";
00048 
00049        return s;
00050 }
00051 
00052 QString Building::getXmlDescription()
00053 {
00054        QString s="<Building>\n";
00055        s+="   <Name>"+protect(this->name)+"</Name>\n";
00056        s+="</Building>\n";
00057 
00058        return s;
00059 }
00060 
00061 QString Building::getDetailedDescriptionWithConstraints(Rules& r)
00062 {
00063        Q_UNUSED(r);
00064 
00065        QString s=this->getDetailedDescription();
00066 
00067        /*s+="--------------------------------------------------\n";
00068        s+=tr("Space constraints directly related to this building:");
00069        s+="\n";
00070        for(int i=0; i<r.spaceConstraintsList.size(); i++){
00071               SpaceConstraint* c=r.spaceConstraintsList[i];
00072               if(c->isRelatedToBuilding(this)){
00073                      s+="\n";
00074                      s+=c->getDetailedDescription(r);
00075               }
00076        }
00077        s+="--------------------------------------------------\n";*/
00078 
00079        return s;
00080 }
00081 
00082 int buildingsAscending (const Building* b1, const Building* b2)
00083 {
00084        return b1->name < b2->name;
00085 }