1 /***************************************************************************
2 planet.cpp - description
5 copyright : (C) 2002 by Michael Andreen
7 ***************************************************************************/
9 /***************************************************************************
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
16 ***************************************************************************/
31 //////////////////////////////////////////////////////////////////////////
33 unsigned Planet::planetScore() const
38 //////////////////////////////////////////////////////////////////////////
40 void Planet::setPlanetScore(unsigned i)
45 //////////////////////////////////////////////////////////////////////////
47 int Planet::roids(std::string type, int tick = 0) const
49 // const... I would like [] as for const types: int ticks = m_Roids[type].size();
51 vector<int>const* roids = 0;
52 for (RoidList::const_iterator i = m_Roids.begin(); i != m_Roids.end(); ++i)
63 int ticks = roids->size();
68 return roids->at(ticks);
69 return roids->at(tick);
72 //////////////////////////////////////////////////////////////////////////
74 void Planet::setRoids(std::string type, int number)
76 if (m_Roids[type].size() == 0)
77 m_Roids[type].push_back(number);
78 m_Roids[type][0] = number;
81 //////////////////////////////////////////////////////////////////////////
83 void runBattle(std::vector<Fleet*> friendly, std::vector<Fleet*> hostile)