Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CLocalPlayer Class Reference

Player. More...

#include <LocalPlayer.h>

Inheritance diagram for CLocalPlayer:

CPlayer CGenericTask CAIModule CAIPlayer CAIPlayer CHumanPlayer CBackgammonAI COthelloAI CStrategoAI CTicTacToeAI List of all members.

Public Member Functions

 CLocalPlayer ()
 CLocalPlayer.
virtual ~CLocalPlayer (void)
 ~CLocalPlayer
bool AttachListener (CBSock *)
 AttachListener.
bool DetachListener (CBSock *)
 DetachListener.
void DetachAllListeners ()
 DetachAllListeners.

Protected Member Functions

void AcceptListers (bool bAccept=true)
 VERSION CONTROL HISTORY
Revision
1.1
.
virtual bool OnSpectatorMsg (CMessage *pMsg, uint32 iSpectatorNumber)
 OnSpectatorMsg.
bool OnInit ()
 OnInit.
bool OnBackgroundProc ()
 OnBackgroundProc.
virtual void OnMessageReceived (CMessage *pMsg)
bool OnMessageSent (CMessage *pMsg)
 OnMessageSent.
bool PostIdentity (uint32 uiRecipient=CAFFEINE_BROADCAST)
 PostIdentity.
void OnIdentMessage (const CIdentMessage *pMsg)
 OnIdentMessage.

Detailed Description

Player.

Description: The Player class provides an interface for all player objects that communicate through the primary message loop.

Limitations:


Constructor & Destructor Documentation

CLocalPlayer::CLocalPlayer  ) 
 

CLocalPlayer.

Description: The CLocalPlayer constructor initializes internal attributes.

Returns:
None
Limitations: None

CLocalPlayer::~CLocalPlayer void   )  [virtual]
 

~CLocalPlayer

Description: The destructor has been included for maintenance purposes only.

Returns:
None
Limitations: None


Member Function Documentation

void CLocalPlayer::AcceptListers bool  bAccept = true  )  [inline, protected]
 

VERSION CONTROL HISTORY

Revision
1.1
.

Log
LocalPlayer.hpp,v
Revision 1.1 2005/06/12 18:22:17 mabruns Initial Import

Revision 1.2 2005/03/21 21:42:28 kjm266 CDescription and the CEID is now properly set. Get functions are now constant.

Revision 1.1 2005/03/20 23:55:48 tcsvw5 Moved inline functions to a seperate file

Revision 1.0 2005/02/03 20:39:04 cafene Added CVS expansion keywords to the template.

bool CLocalPlayer::AttachListener CBSock pListener  ) 
 

AttachListener.

Description: This function attaches a listener to the LocalPlayer. When spectators (listeners) are attached to the player, they will received a copy of many of the outgoign and incoming messages.

Parameters:
pListener - The socket object that has been opened to a GUI listner.
Returns:
None
Limitations: None

void CLocalPlayer::DetachAllListeners  ) 
 

DetachAllListeners.

Description: This function is used to detach all attached spectators from the CLocalPlayer object.

Returns:
None
Limitations: None

bool CLocalPlayer::DetachListener CBSock pSock  ) 
 

DetachListener.

Description: This function attempts to detach a particular listener from the CLocalPlayer object.

Parameters:
pSock - A pointer to the listener to remove.
Returns:
bool: true if the listner was removed; false if the listener was not found or could not be removed.
Limitations: Detaching a listener can alter the index of at most one of the remaining listeners.

bool CLocalPlayer::OnBackgroundProc  )  [protected, virtual]
 

OnBackgroundProc.

Description: This handler function is called by the framework to allow for custom, low-priority processing. In this version, the process function of CBSocket class is called for each of the of the attached spectators.

Returns:
Bool: If the background processing is complete, the funtion returns true. If more processing time is needed, the function returns false.
Limitations: None

Reimplemented from CPlayer.

Reimplemented in CHumanPlayer.

void CLocalPlayer::OnIdentMessage const CIdentMessage pMsg  )  [protected]
 

OnIdentMessage.

Description: This function processes all Identity family(MSG_IDENT_FAMILY) messages.

Parameters:
pMsg - The CIdentMessage that is to be processed.
Returns:
None
Limitations: None

bool CLocalPlayer::OnInit  )  [protected, virtual]
 

OnInit.

Description: The OnInit function is called right when the thread is started. This function posts the identification message to the system.

Returns:
bool: True if the player was initialized. False if the player failed to initialize.
Limitations: None

Reimplemented from CPlayer.

Reimplemented in CHumanPlayer.

void CLocalPlayer::OnMessageReceived CMessage pMsg  )  [protected, virtual]
 

Returns:
void
Limitations: None

Reimplemented from CPlayer.

Reimplemented in CAIPlayer, CAIPlayer, and CHumanPlayer.

bool CLocalPlayer::OnMessageSent CMessage pMsg  )  [protected, virtual]
 

OnMessageSent.

Description: This handler function is called by the framework when the client sends a message via the PostAMessage function to the host. The sent message is copied and forwared to the attched spectators, if any.

Returns:
bool: True to indicate that the message should be sent
Limitations: None

Reimplemented from CPlayer.

bool CLocalPlayer::OnSpectatorMsg CMessage pMsg,
uint32  iSpectatorNumber
[protected, virtual]
 

OnSpectatorMsg.

Description: This function handler is called before message sent by a spectator is actually sent. This handler should be used to filter outgoing messages.

Parameters:
pMsg - The message to be filtered.
iSpectatorNumber - The index of the spectator that sent the message.
Returns:
None
Limitations: None

Reimplemented in CHumanPlayer.

bool CLocalPlayer::PostIdentity uint32  uiRecipient = CAFFEINE_BROADCAST  )  [protected]
 

PostIdentity.

Description: This function is internal to the CLocalPlayer class. It creates a CIdentMessage filled with the player's associated identification attributes and sends the message to the specified receipient.

Parameters:
uiRecipient - The mailbox number of the desired recipient. This value can be CAFFEINE_BROADCAST.
Returns:
bool: True if the message was successfully sent, else false.
Limitations: None


The documentation for this class was generated from the following files:
Copyright (c) 2005 Matt Bruns, Pat Hammond, Kevin Markussen, Travis Service, Brain Shaver

SourceForge.net Logo