#include <Player.h>
Inheritance diagram for CPlayer:
Public Member Functions | |
CPlayer () | |
CPlayer. | |
virtual | ~CPlayer (void) |
~CPlayer | |
void | AttachMailbox (CMailbox *) |
AttachMailbox. | |
Protected Member Functions | |
void | Run () |
Run. | |
void | EnableBackgroundProcessing (bool bProcessing) |
EnableBackgroundProcessing. | |
bool | PostAMessage (CMessage *pMsg) |
PostMessage. | |
virtual bool | OnInit () |
OnInit This handler function is called before the execution of the threads main loop. | |
virtual void | OnMessageReceived (CMessage *pMsg) |
OnMessageRecieved This handler function is called when the player receives a message from the host. | |
virtual bool | OnMessageSent (CMessage *pMsg) |
OnMessageSent This handler function is called whenever the player sends a message to the host. | |
virtual void | OnForegroundProc () |
OnForegroundProc This function is called by the framework rapidly in order to perform needed forground processing. | |
virtual bool | OnBackgroundProc () |
OnBackgroundProc This function is called by the framework when the player's message queue is empty. |
Description: The Player class provides an interface for all player objects that communicate through the primary message loop.
Limitations:
|
CPlayer. Description: : This function initalizes the class's internal data members
|
|
~CPlayer Description: This destructor has been included for maintenance purposes only.
|
|
AttachMailbox. Description: : This function attaches a mailbox to the player. The player thread cannot be started unless a mailbox is attached
|
|
EnableBackgroundProcessing. Description: : This function sets the background processing mode of the player object.
|
|
OnBackgroundProc This function is called by the framework when the player's message queue is empty. Return true if more processing time is needed. Reimplemented in CHumanPlayer, and CLocalPlayer. |
|
OnForegroundProc This function is called by the framework rapidly in order to perform needed forground processing. Description: : This function handler is called during each iteration of the thread's processing loop. This version, however, has just been included for maintenance purposes.
Reimplemented in CNetworkPlayer. |
|
OnInit This handler function is called before the execution of the threads main loop. If the return of this function is false, the main loop will not be executed. Reimplemented in CHumanPlayer, CLocalPlayer, and CNetworkPlayer. |
|
OnMessageRecieved This handler function is called when the player receives a message from the host. This function should perform all custom processing of the message. Reimplemented in CAIPlayer, CAIPlayer, CHumanPlayer, CLocalPlayer, and CNetworkPlayer. |
|
OnMessageSent This handler function is called whenever the player sends a message to the host. Description: : This function handler is called when a message is to be sent to the host. This version of the function, however, has been included for maintenance.
Reimplemented in CLocalPlayer, and CTournamentPlayer. |
|
PostMessage. Description: Use this function to send messages to other players. The outgoing message is added to a "send" queue that is managed by the CMailbox class.
|
|
Run. Description: This function processes the player task's message loop. This function will not return until the task is stopped.
Implements CGenericTask. |