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

dmn::CoreStandard Class Reference

standard Core module More...

#include <standard.h>

Inheritance diagram for dmn::CoreStandard:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 CoreStandard ()
 Constructor.

bool play (const std::list< PlayerInfo > &teams, const std::string &tournament, const std::string &match, const std::string &game, const std::string &hand, const std::string &display, const std::string &sound)
 Plays domino.

bool classification_of_tournament (ID tournament, std::list< ID > *teams)
 Classification of the tournament.

void score_board_match (ID match, std::list< Score > *score)
 Score board of the match.

bool is_first_hand_of_game (ID game, ID hand)
 Check if the identificator is the first hand of this game.

void score_board_game (ID game, std::list< Score > *score)
 Score board of the game.

ID player_who_started_in_hand (ID hand)
 Player who started the hand.

int number_dominoes_in_hand (ID hand)
 Number of dominoes that has the hand.

HalfDomino max_half_value_in_hand (ID hand)
 Maximum half value in the hand (the halfs must be 0...max_half_value()).

int dominoes_in_hand (ID hand, Dominoes *dominoes)
 Return the dominoes played in a hand.

int dominoes_has_player_in_hand (ID hand, ID player)
 Return the number of dominoes that a player has.

bool domino_playable_in_hand (ID hand, Player *player, ID id, Domino domino, HalfDomino half)
 Check if a movement is valid or not.

const std::string player_name (ID player)
 Player's name.

bool is_player_interactive (ID player)
 Check if a player is interactive or not.


Detailed Description

standard Core module


Member Function Documentation

bool dmn::CoreStandard::classification_of_tournament ID  tournament,
std::list< ID > *  teams
[virtual]
 

Classification of the tournament.

Parameters:
tournament identificator for the tournament
teams where to return the team identificators (first to last)
Returns:
true if all was ok, else false

Implements dmn::Core.

bool dmn::CoreStandard::domino_playable_in_hand ID  hand,
Player player,
ID  id,
Domino  domino,
HalfDomino  half
[virtual]
 

Check if a movement is valid or not.

Parameters:
hand hand identificator
player pointer to the Player structure of the player
id identificator of the player
domino domino
half half
Returns:
true if a domino can be played, else false

Implements dmn::Core.

int dmn::CoreStandard::dominoes_has_player_in_hand ID  hand,
ID  player
[virtual]
 

Return the number of dominoes that a player has.

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

Implements dmn::Core.

int dmn::CoreStandard::dominoes_in_hand ID  hand,
Dominoes dominoes
[virtual]
 

Return the dominoes played in a hand.

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

Implements dmn::Core.

bool dmn::CoreStandard::is_first_hand_of_game ID  game,
ID  hand
[virtual]
 

Check if the identificator is the first hand of this game.

Parameters:
game indentificator of the game
hand identificator of the hand
Returns:
true if hand is the first hand of the game, else false

Implements dmn::Core.

bool dmn::CoreStandard::is_player_interactive ID  player  )  [virtual]
 

Check if a player is interactive or not.

Parameters:
player identificator of the player
Returns:
true if is interactive, else false

Implements dmn::Core.

HalfDomino dmn::CoreStandard::max_half_value_in_hand ID  hand  )  [virtual]
 

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

Parameters:
hand identificator of the hand
Returns:
the maximum half value

Implements dmn::Core.

int dmn::CoreStandard::number_dominoes_in_hand ID  hand  )  [virtual]
 

Number of dominoes that has the hand.

Parameters:
hand identificator of the hand
Returns:
the number of dominoes

Implements dmn::Core.

bool dmn::CoreStandard::play const std::list< PlayerInfo > &  teams,
const std::string &  tournament,
const std::string &  match,
const std::string &  game,
const std::string &  hand,
const std::string &  display,
const std::string &  sound
[virtual]
 

Plays domino.

Parameters:
teams path to teams[couples[players]] Player modules
tournament path to the Tournament module
match path to the Match module
game path to the Game module
hand path to the Hand module
display path to the Display module
sound path to the Sound module
Returns:
true if all was ok, else false

Implements dmn::Core.

const std::string dmn::CoreStandard::player_name ID  player  )  [virtual]
 

Player's name.

Parameters:
player identificator of the player
Returns:
the name

Implements dmn::Core.

ID dmn::CoreStandard::player_who_started_in_hand ID  hand  )  [virtual]
 

Player who started the hand.

Parameters:
hand identificator of the hand
Returns:
the player's identificator

Implements dmn::Core.

void dmn::CoreStandard::score_board_game ID  game,
std::list< Score > *  score
[virtual]
 

Score board of the game.

score must have space for the score board

Parameters:
game indentificator of the game
score where the score board is returned (score_t)
Returns:
true if all was ok, else false

Implements dmn::Core.

void dmn::CoreStandard::score_board_match ID  match,
std::list< Score > *  score
[virtual]
 

Score board of the match.

score must have space for the score board

Parameters:
match identifictor of the match
score where the score board is returned

Implements dmn::Core.


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