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

dmn::Hand Class Reference

Hand interface. More...

#include <hand.h>

Inheritance diagram for dmn::Hand:

Inheritance graph
[legend]
Collaboration diagram for dmn::Hand:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Hand ()
 Constructor.

virtual ~Hand ()
 Destructor.

virtual bool configure (Core *core)=0
 Make all the configuration needed by the module (after have the id).

virtual ID player_who_started ()=0
 Player who started the hand.

virtual void set_player_who_starts (ID player)=0
 Set the player who starts playing.

virtual ID turn ()=0
 Player who plays.

virtual int number_dominoes ()=0
 Number of dominoes that has the hand.

virtual HalfDomino max_half_value ()=0
 Maximum half value (the halfs must be 0...max_half_value()).

virtual int dominoes_played (Dominoes *dominoes)=0
 Return the dominoes played in a hand.

virtual int dominoes_has_player (ID player)=0
 Return the number of dominoes that a player has.

virtual bool shuffle_tile (ID *player, Domino *domino)=0
 Shuffling a tile for a player.

virtual bool domino_playable (ID player, Domino domino, HalfDomino half)=0
 Check if a movement is valid or not.

virtual void set_play_domino (ID player, Domino domino, HalfDomino half)=0
 A player play a domino.

virtual bool set_player_pass (ID player, Domino *domino)=0
 A player hasn't got a domino to play, a domino can be gived to him.

virtual ID winner (Points *points)=0
 Check if the game is finished (there is a winner).

virtual bool is_finished ()=0
 Check if the hand is finished or not.


Detailed Description

Hand interface.


Member Function Documentation

virtual bool dmn::Hand::configure Core core  )  [pure virtual]
 

Make all the configuration needed by the module (after have the id).

Parameters:
core core module
Returns:
true if all was ok, else false

Implemented in dmn::HandDefault.

virtual bool dmn::Hand::domino_playable ID  player,
Domino  domino,
HalfDomino  half
[pure virtual]
 

Check if a movement is valid or not.

Parameters:
player identificator of the player that take the tile
domino domino that is shuffled to player
half 
Returns:
true if the domino can be played, else false

Implemented in dmn::HandDefault.

virtual int dmn::Hand::dominoes_has_player ID  player  )  [pure virtual]
 

Return the number of dominoes that a player has.

Parameters:
player identificator of the player
Returns:
the number of dominoes of the player (-1 = error)

Implemented in dmn::HandDefault.

virtual int dmn::Hand::dominoes_played Dominoes dominoes  )  [pure virtual]
 

Return the dominoes played in a hand.

Parameters:
dominoes where to return the dominoes in a List_t
Returns:
the number of dominoes

Implemented in dmn::HandDefault.

virtual bool dmn::Hand::is_finished  )  [pure virtual]
 

Check if the hand is finished or not.

Returns:
true if the hand is finished, false if not

Implemented in dmn::HandDefault.

virtual HalfDomino dmn::Hand::max_half_value  )  [pure virtual]
 

Maximum half value (the halfs must be 0...max_half_value()).

Returns:
the maximum half value

Implemented in dmn::HandDefault.

virtual int dmn::Hand::number_dominoes  )  [pure virtual]
 

Number of dominoes that has the hand.

Returns:
the number of dominoes

Implemented in dmn::HandDefault.

virtual ID dmn::Hand::player_who_started  )  [pure virtual]
 

Player who started the hand.

Returns:
the player's identificator

Implemented in dmn::HandDefault.

virtual void dmn::Hand::set_play_domino ID  player,
Domino  domino,
HalfDomino  half
[pure virtual]
 

A player play a domino.

Parameters:
player identificator of the player
domino domino played
half half of the domino

Implemented in dmn::HandDefault.

virtual bool dmn::Hand::set_player_pass ID  player,
Domino domino
[pure virtual]
 

A player hasn't got a domino to play, a domino can be gived to him.

Parameters:
player identificator of the player that take the tile
domino domino that is shuffled to player
Returns:
true if a domino is gived to the player or false if not

Implemented in dmn::HandDefault.

virtual void dmn::Hand::set_player_who_starts ID  player  )  [pure virtual]
 

Set the player who starts playing.

Parameters:
player identificator of the player who starts playing

Implemented in dmn::HandDefault.

virtual bool dmn::Hand::shuffle_tile ID player,
Domino domino
[pure virtual]
 

Shuffling a tile for a player.

Parameters:
player where return identificator of the player that take the tile
domino domino
Returns:
true if the tile is shuffled, or false if all the tiles are shuffled or error

Implemented in dmn::HandDefault.

virtual ID dmn::Hand::turn  )  [pure virtual]
 

Player who plays.

Returns:
the player who plays or ID_NULL if something is wrong

Implemented in dmn::HandDefault.

virtual ID dmn::Hand::winner Points points  )  [pure virtual]
 

Check if the game is finished (there is a winner).

Couples can draw. In this case, winner will be DMN_ID_NULL

Parameters:
points points made by the winner
Returns:
player winner or ID_NULL if there isn't one

Implemented in dmn::HandDefault.


The documentation for this class was generated from the following file:
Generated on Fri Dec 26 22:55:35 2003 for dmn by doxygen 1.3.4