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

dmn::HandDefault Class Reference

Default Hand module. More...

#include <default.h>

Inheritance diagram for dmn::HandDefault:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 HandDefault ()
 Constructor.

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

ID player_who_started ()
 Player who started the hand.

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

ID turn ()
 Player who plays.

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

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

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

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

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

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

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

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

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

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


Detailed Description

Default Hand module.

Hand with common rules


Member Function Documentation

bool dmn::HandDefault::configure Core core  )  [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

Implements dmn::Hand.

bool dmn::HandDefault::domino_playable ID  player,
Domino  domino,
HalfDomino  half
[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

Implements dmn::Hand.

int dmn::HandDefault::dominoes_has_player ID  player  )  [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)

Implements dmn::Hand.

int dmn::HandDefault::dominoes_played Dominoes dominoes  )  [virtual]
 

Return the dominoes played in a hand.

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

Implements dmn::Hand.

bool dmn::HandDefault::is_finished  )  [virtual]
 

Check if the hand is finished or not.

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

Implements dmn::Hand.

HalfDomino dmn::HandDefault::max_half_value  )  [virtual]
 

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

Returns:
the maximum half value

Implements dmn::Hand.

int dmn::HandDefault::number_dominoes  )  [virtual]
 

Number of dominoes that has the hand.

Returns:
the number of dominoes

Implements dmn::Hand.

ID dmn::HandDefault::player_who_started  )  [virtual]
 

Player who started the hand.

Returns:
the player's identificator

Implements dmn::Hand.

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

A player play a domino.

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

Implements dmn::Hand.

bool dmn::HandDefault::set_player_pass ID  player,
Domino domino
[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

Implements dmn::Hand.

void dmn::HandDefault::set_player_who_starts ID  player  )  [virtual]
 

Set the player who starts playing.

Parameters:
player identificator of the player who starts playing

Implements dmn::Hand.

bool dmn::HandDefault::shuffle_tile ID player,
Domino domino
[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

Implements dmn::Hand.

ID dmn::HandDefault::turn  )  [virtual]
 

Player who plays.

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

Implements dmn::Hand.

ID dmn::HandDefault::winner Points points  )  [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

Implements dmn::Hand.


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