Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

ObstacleGrid::EraseFunc Class Reference

The EraseFunc class is used by for_each_2d_vector (used by erase ()) and erases the pointer to the Obstacle from each of the squares that it is in. More...

#include <obstacle_grid.h>

Inherits ObstacleGrid::MyFuncBase.

Inheritance diagram for ObstacleGrid::EraseFunc:

Inheritance graph
[legend]
Collaboration diagram for ObstacleGrid::EraseFunc:

Collaboration graph
[legend]
List of all members.

Public Methods

 EraseFunc (ObstacleGrid *myparent, Obstacle *obstacle)
void operator() (Vector pos)
 The () operator is called by for_each_2d_vector so that a function can be done for each Vector . More...


Detailed Description

The EraseFunc class is used by for_each_2d_vector (used by erase ()) and erases the pointer to the Obstacle from each of the squares that it is in.


Constructor & Destructor Documentation

ObstacleGrid::EraseFunc::EraseFunc ObstacleGrid   myparent,
Obstacle   obstacle
[inline]
 

00107 : MyFuncBase(myparent,obstacle){}


Member Function Documentation

void ObstacleGrid::EraseFunc::operator() Vector    pos [inline]
 

The () operator is called by for_each_2d_vector so that a function can be done for each Vector .

00109                                            {
00110             ObstMap::iterator iter=parent->getByColl(pos);
00111             while (iter!=iter.end()) {
00112                 if (&(*iter->second)==obst) {
00113                     printf ("Erasing %X (%f,%f)\n",obst,pos.i,pos.j);
00114                     parent->collObst.erase(iter);
00115                     break;
00116                 }
00117                 ++iter;
00118             }
00119         }


The documentation for this class was generated from the following file:
Generated on Mon Jul 7 21:13:54 2003 for Ethereal by doxygen1.2.15