COandXController Class Reference

List of all members.

Public Types

enum  TState {
  ENewGame, EPlaying, EFinished, ENewGame,
  EPlaying, EFinished
}
enum  TState {
  ENewGame, EPlaying, EFinished, ENewGame,
  EPlaying, EFinished
}

Public Member Functions

virtual ~COandXController ()
void Reset ()
TBool HitSquareL (TInt aIndex)
void SwitchTurn ()
TBool IsNewGame () const
TBool IsCrossTurn () const
void ExternalizeL (RWriteStream &aStream) const
void InternalizeL (RReadStream &aStream)
void Reset ()
TBool HitSquareL (TInt aIndex)
void SwitchTurn ()
void ResetStats ()
TBool IsNewGame () const
TBool IsCrossTurn () const
TUint GamesPlayed () const
TUint WonByO () const
TUint WonByX () const
TTileState GameRecord (TInt aIndex)
void ExternalizeL (RWriteStream &aStream) const
void InternalizeL (RReadStream &aStream)

Static Public Member Functions

static COandXControllerNewL ()
static COandXControllerNewL ()

Detailed Description

This controller uses instructions from the user to update the engine (board.)

Definition at line 33 of file oandxcontroller.h.


Constructor & Destructor Documentation

COandXController::~COandXController (  )  [virtual]

Destructor is defined here to ensure only one instance is generated.

Definition at line 49 of file oandxcontroller.cpp.


Member Function Documentation

COandXController * COandXController::NewL (  )  [static]

Factory function allocates new instance of COandXController.

Returns:
New, initialized instance of COandXController. This object is owned by the caller.

Definition at line 26 of file oandxcontroller.cpp.

void COandXController::Reset (  ) 

Cancel the current game, clearing the board and setting noughts as the current player.

Definition at line 88 of file oandxcontroller.cpp.

void COandXController::ExternalizeL ( RWriteStream &  aStream  )  const

Persist the controller's state to the supplied stream. Specifically, writes out the state, whose turn it is, and which symbol the local player is using.

Parameters:
aStream Stream to which the controller's state will be written.
See also:
InternalizeL

Definition at line 60 of file oandxcontroller.cpp.

void COandXController::InternalizeL ( RReadStream &  aStream  ) 

Standard stream store internalization function, restores state, whose turn, and which symbol the local player is using.

Parameters:
aStream Stream which contains externalized state.
See also:
ExternalizeL

Definition at line 75 of file oandxcontroller.cpp.


Generated by  doxygen 1.6.2