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

MoveList Class Reference

#include <moves.h>

List of all members.

Public Methods

 MoveList ()
 ~MoveList ()
void Append (Move *a)
MoveGetCurrent (void)
MoveGetLast (void)
bool Reset (void)
bool Next (void)
int Length (void)
void Nuke (void)

Private Methods

void Insert (Move *a)

Private Attributes

MoveFirst
MoveLast
MoveCurrent
int Len


Constructor & Destructor Documentation

MoveList::MoveList   [inline]
 

Definition at line 77 of file moves.h.

References Len.

00077 { First = Last = Current = 0; Len = 0;}

MoveList::~MoveList   [inline]
 

Definition at line 78 of file moves.h.

References Nuke().

00078 { Nuke (); }


Member Function Documentation

void MoveList::Append Move   a
 

Definition at line 22 of file moves.c.

References Insert(), Last, Len, and Move::Next.

Referenced by Spy::TakeTurn().

00023 {
00024   if (Last)
00025   {
00026     Last->Next = a;
00027     Last = a;
00028     Len++;
00029   }
00030   else
00031     Insert (a);
00032 }

Move* MoveList::GetCurrent void    [inline]
 

Definition at line 80 of file moves.h.

Referenced by UserInterface::ComputePossTokens(), MapWindow::DisableNodes(), MapWindow::EnableNodes(), and UserInterface::ShowSpyMoves().

00080 { return Current; }

Move* MoveList::GetLast void    [inline]
 

Definition at line 81 of file moves.h.

00081 { return Last; }

void MoveList::Insert Move   a [private]
 

Definition at line 11 of file moves.c.

References Current, First, Last, Len, and Move::Next.

Referenced by Append().

00012 {
00013   a->Next = First;
00014   First = a;
00015   Len++;
00016   if (!Current)
00017     Current = First;
00018   if (!Last)
00019     Last = First;
00020 }

int MoveList::Length void    [inline]
 

Definition at line 84 of file moves.h.

References Len.

Referenced by Human::ChooseMove(), and Rules::DetectivesTrapped().

00084 { return Len; }

bool MoveList::Next void   
 

Definition at line 42 of file moves.c.

References Current, and Move::Next.

Referenced by UserInterface::ComputePossTokens(), MapWindow::DisableNodes(), MapWindow::EnableNodes(), and UserInterface::ShowSpyMoves().

00043 {
00044   if (Current)
00045     Current = Current->Next;
00046   return (bool) (Current);
00047 }

void MoveList::Nuke void   
 

Definition at line 49 of file moves.c.

References Current, First, Last, and Len.

Referenced by ~MoveList().

00050 {
00051   delete First;
00052   First = Current = Last = 0;
00053   Len = 0;
00054 }

bool MoveList::Reset void   
 

Definition at line 35 of file moves.c.

References Current, and First.

Referenced by UserInterface::ComputePossTokens(), MapWindow::DisableNodes(), MapWindow::EnableNodes(), and UserInterface::ShowSpyMoves().

00036 {
00037   Current = First;
00038   return (bool) (Current);
00039 }


Member Data Documentation

Move* MoveList::Current [private]
 

Definition at line 73 of file moves.h.

Referenced by Insert(), Next(), Nuke(), and Reset().

Move* MoveList::First [private]
 

Definition at line 71 of file moves.h.

Referenced by Insert(), Nuke(), and Reset().

Move* MoveList::Last [private]
 

Definition at line 72 of file moves.h.

Referenced by Append(), Insert(), and Nuke().

int MoveList::Len [private]
 

Definition at line 74 of file moves.h.

Referenced by Append(), Insert(), Length(), MoveList(), and Nuke().


The documentation for this class was generated from the following files:
Generated on Sun Jul 6 23:07:17 2003 for Scotland Yard by doxygen1.2.15