ObjectsList Class Reference

#include <objects_list.h>

List of all members.

Public Types

typedef std::list< PhysicalObj
* >::iterator 
iterator

Public Member Functions

void RemoveObject (PhysicalObj *obj)
 ~ObjectsList ()
void AddObject (PhysicalObj *obj)
void Refresh ()
void Draw ()
bool AllReady ()
void PlaceMines ()
void PlaceBarrels ()
void FreeMem ()


Detailed Description

Definition at line 46 of file objects_list.h.


Member Typedef Documentation

typedef std::list<PhysicalObj*>::iterator ObjectsList::iterator

Definition at line 49 of file objects_list.h.


Constructor & Destructor Documentation

ObjectsList::~ObjectsList (  ) 

Definition at line 73 of file objects_list.cpp.

00074 {
00075   FreeMem();
00076 }

Here is the call graph for this function:


Member Function Documentation

void ObjectsList::AddObject ( PhysicalObj obj  )  [inline]

Definition at line 54 of file objects_list.h.

00054 { push_back(obj);};

Here is the caller graph for this function:

bool ObjectsList::AllReady (  ) 

Definition at line 112 of file objects_list.cpp.

00113 {
00114   FOR_EACH_OBJECT(object)
00115   {
00116     if (!(*object)->IsImmobile())
00117     {
00118       MSG_DEBUG("lst_objects", "\"%s\" is not ready ( IsImmobile()==fasle )", (*object)->GetName().c_str());
00119       return false;
00120     }
00121   }
00122   return true;
00123 }

void ObjectsList::Draw (  ) 

Definition at line 95 of file objects_list.cpp.

00096 {
00097   for (ObjectsList::iterator it = begin();
00098        it != end();
00099        ++it)
00100   {
00101     assert((*it) != NULL);
00102     if(Time::GetInstance()->IsGamePaused())
00103     {
00104       MSG_DEBUG("lst_objects","Displaying %s",(*it)->GetName().c_str());
00105     }
00106     if (!(*it)->IsGhost())
00107       (*it)->Draw();
00108   }
00109 }

Here is the call graph for this function:

Here is the caller graph for this function:

void ObjectsList::FreeMem (  ) 

Definition at line 127 of file objects_list.cpp.

00128 {
00129   MSG_DEBUG("lst_objects", "Erasing object list");
00130   ObjectsList::iterator object;
00131   for (object = begin();
00132        object != end();
00133        ++object) {
00134     if((*object))
00135       delete (*object);
00136   }
00137   clear();
00138 }

Here is the caller graph for this function:

void ObjectsList::PlaceBarrels (  ) 

Definition at line 58 of file objects_list.cpp.

00059 {
00060   MSG_DEBUG("lst_objects","Placing barrels");
00061   for (uint i= 0; i<ActiveMap().GetNbBarrel(); ++i)
00062   {
00063     PetrolBarrel *obj = new PetrolBarrel();
00064 
00065     if (obj->PutRandomly(false, 20.0))
00066       push_back(obj);
00067     else
00068       delete obj;
00069   }
00070 }

Here is the call graph for this function:

Here is the caller graph for this function:

void ObjectsList::PlaceMines (  ) 

Definition at line 43 of file objects_list.cpp.

00044 {
00045   MSG_DEBUG("lst_objects","Placing mines");
00046   for (uint i=0; i<ActiveMap().GetNbMine(); ++i)
00047   {
00048     ObjMine *obj = new ObjMine(*MineConfig::GetInstance());
00049 
00050     if (obj->PutRandomly(false, MineConfig::GetInstance()->detection_range * PIXEL_PER_METER *1.5 ))
00051       // detection range is in meter
00052       push_back(obj);
00053     else
00054       delete obj;
00055   }
00056 }

Here is the call graph for this function:

Here is the caller graph for this function:

void ObjectsList::Refresh (  ) 

Definition at line 79 of file objects_list.cpp.

00080 {
00081   ObjectsList::iterator object=begin();
00082 
00083   while(object != end())
00084   {
00085     (*object)->UpdatePosition();
00086     (*object)->Refresh();
00087     if((*object)->IsGhost())
00088       object = lst_objects.erase(object);
00089     else
00090       object++;
00091   }
00092 }

Here is the caller graph for this function:

void ObjectsList::RemoveObject ( PhysicalObj obj  )  [inline]

Definition at line 49 of file objects_list.h.

00049 { remove(obj);};


The documentation for this class was generated from the following files:
Generated on Mon Jan 1 14:04:22 2007 for Wormux by  doxygen 1.4.7