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

Detective Class Reference

#include <players.h>

Inheritance diagram for Detective:

Player ComputerDetective HumanDetective List of all members.

Public Methods

 Detective (void)
bool IsSpy (void)
int NumTokens (TokenType t)
Move TakeTurn (void)

Private Attributes

int Tokens [NTokenTypes]

Constructor & Destructor Documentation

Detective::Detective void   
 

Definition at line 37 of file players.c.

References NTokenTypes, Tokens, and TokenType.

00038   {
00039    for (int i=0; i < NTokenTypes; i++)
00040   Tokens [i] = theRules.StartingTokens ((TokenType) i);
00041   }


Member Function Documentation

bool Detective::IsSpy void    [inline, virtual]
 

Reimplemented from Player.

Definition at line 64 of file players.h.

References False.

00064 { return False; }

int Detective::NumTokens TokenType    t [inline, virtual]
 

Reimplemented from Player.

Definition at line 65 of file players.h.

References Tokens, and TokenType.

Referenced by ComputerDetective::CanLeave().

00065 { return (Tokens [t]); }

Move Detective::TakeTurn void    [virtual]
 

Reimplemented from Player.

Definition at line 43 of file players.c.

References Bus, BusMask, Player::ChooseMove(), Move::Node, NullMove, Player::Pos, Subway, SubwayMask, Taxi, TaxiMask, Tokens, and Move::Trans.

00044   {
00045    UI.BeginTurn (*this);
00046    Move m = ChooseMove ();
00047    if (m != NullMove)
00048      {
00049       if (m.Trans & TaxiMask)              // update tokens
00050   Tokens[Taxi]--;
00051       else if (m.Trans & BusMask)
00052   Tokens[Bus]--;
00053       else if (m.Trans & SubwayMask)
00054   Tokens[Subway]--;
00055       UI.EndTurn (*this, m);
00056       Pos = m.Node;
00057      }
00058    return m;
00059   }


Member Data Documentation

int Detective::Tokens[NTokenTypes] [private]
 

Definition at line 60 of file players.h.

Referenced by Detective(), NumTokens(), and TakeTurn().


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