Vegastrike 0.5.1 rc1  1.0
Original sources for Vegastrike Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Planet::PlanetIterator Class Reference

#include <planet_generic.h>

Public Member Functions

 PlanetIterator (Planet *p)
 
 ~PlanetIterator ()
 
void preinsert (Unit *unit)
 
void postinsert (Unit *unit)
 
void remove ()
 
Unitcurrent ()
 
void advance ()
 
PlanetIteratoroperator++ ()
 
Unitoperator* ()
 

Detailed Description

Definition at line 190 of file planet_generic.h.

Constructor & Destructor Documentation

Planet::PlanetIterator::PlanetIterator ( Planet p)
inline

Definition at line 192 of file planet_generic.h.

References UnitCollection::append(), and UnitCollection::createIterator().

192  : PlanetIterator( Planet *p )
193  {
194  localCollection.append( p );
195  pos = localCollection.createIterator();
196  }
Planet::PlanetIterator::~PlanetIterator ( )
inline

Definition at line 197 of file planet_generic.h.

197 {}

Member Function Documentation

void Planet::PlanetIterator::advance ( )
inline

Definition at line 216 of file planet_generic.h.

References UnitCollection::append(), UnitCollection::createIterator(), current(), Unit::isUnit(), UnitCollection::UnitIterator::notDone(), PLANETPTR, and Planet::satellites.

Referenced by StarSystem::LoadXML(), and operator++().

217  {
218  if (current() != NULL) {
219  Unit *cur = *pos;
220  if (cur->isUnit() == PLANETPTR)
221  for (un_iter tmp( ( (Planet*) cur )->satellites.createIterator() ); tmp.notDone(); ++tmp)
222  localCollection.append( (*tmp) );
223  ++pos;
224  }
225  }
Unit* Planet::PlanetIterator::current ( )
inline

Definition at line 210 of file planet_generic.h.

References UnitCollection::UnitIterator::notDone().

Referenced by advance(), and operator*().

211  {
212  if ( pos.notDone() )
213  return *pos;
214  return NULL;
215  }
Unit* Planet::PlanetIterator::operator* ( )
inline

Definition at line 231 of file planet_generic.h.

References current().

232  {
233  return current();
234  }
PlanetIterator& Planet::PlanetIterator::operator++ ( )
inline

Definition at line 226 of file planet_generic.h.

References advance().

227  {
228  advance();
229  return *this;
230  }
void Planet::PlanetIterator::postinsert ( Unit unit)
inline

Definition at line 202 of file planet_generic.h.

203  {
204  abort();
205  }
void Planet::PlanetIterator::preinsert ( Unit unit)
inline

Definition at line 198 of file planet_generic.h.

199  {
200  abort();
201  }
void Planet::PlanetIterator::remove ( )
inline

Definition at line 206 of file planet_generic.h.

207  {
208  abort();
209  }

The documentation for this class was generated from the following file: