gCycleMemory Class Reference

#include <gCycle.h>

Collaboration diagram for gCycleMemory:

Collaboration graph
[legend]

List of all members.

Public Member Functions

gCycleMemoryEntryRemember (const gCycle *cycle)
int Len () const
gCycleMemoryEntryoperator() (int i) const
gCycleMemoryEntryLatest (int side) const
gCycleMemoryEntryEarliest (int side) const
void Clear ()
 gCycleMemory ()
 ~gCycleMemory ()

Private Attributes

tList< gCycleMemoryEntrymemory

Friends

class gCycleMemoryEntry


Detailed Description

Definition at line 67 of file gCycle.h.


Constructor & Destructor Documentation

gCycleMemory::gCycleMemory (  ) 

Definition at line 925 of file gAIBase.cpp.

00926 {
00927 }

gCycleMemory::~gCycleMemory (  ) 

Definition at line 930 of file gAIBase.cpp.

References Clear().

00931 {
00932     Clear();
00933 }

Here is the call graph for this function:


Member Function Documentation

gCycleMemoryEntry * gCycleMemory::Remember ( const gCycle cycle  ) 

Definition at line 916 of file gAIBase.cpp.

References GrowingArrayBase::Len(), memory, and tNEW.

00917 {
00918     for (int i=memory.Len()-1; i>=0; i--)
00919         if (memory(i)->cycle == cycle)
00920             return memory(i);
00921 
00922     return tNEW(gCycleMemoryEntry)(this, cycle);
00923 }

Here is the call graph for this function:

int gCycleMemory::Len ( void   )  const [inline]

Definition at line 75 of file gCycle.h.

References GrowingArrayBase::Len(), and memory.

Referenced by operator()().

00075 {return memory.Len();}

Here is the call graph for this function:

Here is the caller graph for this function:

gCycleMemoryEntry * gCycleMemory::operator() ( int  i  )  const

Definition at line 941 of file gAIBase.cpp.

References Len(), memory, and tASSERT.

00942 {
00943     tASSERT(0 <= i && i < Len());
00944     return memory(i);
00945 }

Here is the call graph for this function:

gCycleMemoryEntry * gCycleMemory::Latest ( int  side  )  const

Definition at line 886 of file gAIBase.cpp.

References gCycleMemoryEntry::cycle, gCycleTouchEvent::dist, GrowingArrayBase::Len(), gCycleMemoryEntry::max, memory, and NULL.

Referenced by CheckLoop().

00887 {
00888     side = (side > 0 ? 1 : 0);
00889     gCycleMemoryEntry* ret = NULL;
00890     for (int i=memory.Len()-1; i>=0; i--)
00891     {
00892         gCycleMemoryEntry* m = memory(i);
00893         if ((!ret || (m->max[side].dist > ret->max[side].dist)
00894                 && bool( m->cycle ) && m->cycle->Alive() ))
00895             ret = memory(i);
00896     }
00897 
00898     return ret;
00899 }

Here is the call graph for this function:

Here is the caller graph for this function:

gCycleMemoryEntry * gCycleMemory::Earliest ( int  side  )  const

Definition at line 901 of file gAIBase.cpp.

References gCycleMemoryEntry::cycle, gCycleTouchEvent::dist, GrowingArrayBase::Len(), memory, gCycleMemoryEntry::min, and NULL.

Referenced by CheckLoop().

00902 {
00903     side = (side > 0 ? 1 : 0);
00904     gCycleMemoryEntry* ret = NULL;
00905     for (int i=memory.Len()-1; i>=0; i--)
00906     {
00907         gCycleMemoryEntry* m = memory(i);
00908         if ((!ret || (m->min[side].dist < ret->min[side].dist)
00909                 && bool( m->cycle ) && m->cycle->Alive()))
00910             ret = memory(i);
00911     }
00912     return ret;
00913 }

Here is the call graph for this function:

Here is the caller graph for this function:

void gCycleMemory::Clear ( void   ) 

Definition at line 935 of file gAIBase.cpp.

References GrowingArrayBase::Len(), and memory.

Referenced by ~gCycleMemory().

00936 {
00937     for (int i = memory.Len()-1; i>=0; i--)
00938         delete memory(i);
00939 }

Here is the call graph for this function:

Here is the caller graph for this function:


Friends And Related Function Documentation

friend class gCycleMemoryEntry [friend]

Definition at line 68 of file gCycle.h.


Member Data Documentation

tList<gCycleMemoryEntry> gCycleMemory::memory [private]

Definition at line 70 of file gCycle.h.

Referenced by Clear(), Earliest(), Latest(), Len(), operator()(), and Remember().


The documentation for this class was generated from the following files:
Generated on Sat Mar 15 23:36:59 2008 for Armagetron Advanced by  doxygen 1.5.4