1 // Copyright (C) 2004 John Farrell
3 // This program is free software; you can redistribute it and/or modify
4 // it under the terms of the GNU General Public License as published by
5 // the Free Software Foundation; either version 3 of the License, or
6 // (at your option) any later version.
8 // This program is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // GNU Library General Public License for more details.
13 // You should have received a copy of the GNU General Public License
14 // along with this program; if not, write to the Free Software
15 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 #include "AICityInfo.h"
19 #include "Threatlist.h"
25 //#define debug(x) {cerr<<__FILE__<<": "<<__LINE__<<": "<<x<<flush<<endl;}
28 AICityInfo::AICityInfo(City *c)
29 :d_danger(0), d_reinforcements(0), d_city(c)
31 d_threats = new Threatlist();
32 d_num_defenders = d_city->countDefenders();
35 AICityInfo::~AICityInfo()
37 // the threats in the threatlist do not belong to us
42 void AICityInfo::addThreat(float dangerFromThisThreat, Threat *threat)
44 this->d_danger += dangerFromThisThreat;
45 this->d_threats->push_back(threat);