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

dmn::Core Class Reference

Core interface. More...

#include <core.h>

Inheritance diagram for dmn::Core:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Core ()
 Constructor.

virtual ~Core ()
 Destructor.

virtual 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)=0
 Plays domino.

virtual bool tournaments (std::list< ID > *tournaments)=0
 Tournaments in dmn.

virtual bool matches_in_tournament (ID tournament, std::list< ID > *matches)=0
 Matches in a tournament.

virtual ID tournament_of_match (ID match)=0
 Tournament owner of the match.

virtual bool teams_in_tournament (ID tournament, std::list< ID > *teams)=0
 Teams in a tournament.

virtual ID tournament_of_team (ID team)=0
 Tournament of the team.

virtual bool displays_in_tournament (ID tournament, std::list< ID > *displays)=0
 Displays in a tournament.

virtual ID tournament_of_display (ID display)=0
 Tournament of the display.

virtual bool games_in_match (ID match, std::list< ID > *games)=0
 Games in a match.

virtual ID match_of_game (ID game)=0
 Match owner of the game.

virtual bool couples_in_match (ID match, std::list< ID > *couples)=0
 Couples in a match.

virtual ID match_of_couple (ID couple)=0
 Match of the couple.

virtual bool displays_in_match (ID match, std::list< ID > *displays)=0
 Displays in a match.

virtual ID match_of_display (ID display)=0
 Match of the display.

virtual bool hands_in_game (ID game, std::list< ID > *hands)=0
 Hands in a game.

virtual ID game_of_hand (ID hand)=0
 Game owner of the hand.

virtual bool couples_in_game (ID game, std::list< ID > *couples)=0
 Couples in a game.

virtual ID game_of_couple (ID couple)=0
 Game of the couple.

virtual bool displays_in_game (ID game, std::list< ID > *displays)=0
 Displays in a game.

virtual ID game_of_display (ID display)=0
 Game of the display.

virtual bool players_in_hand (ID hand, std::list< ID > *players)=0
 Players in a hand.

virtual ID hand_of_player (ID player)=0
 Hand of the player.

virtual bool displays_in_hand (ID hand, std::list< ID > *displays)=0
 Displays in a hand.

virtual ID hand_of_display (ID display)=0
 Hand of the display.

virtual bool sounds_in_hand (ID hand, std::list< ID > *sounds)=0
 Sounds in a hand.

virtual ID hand_of_sound (ID sound)=0
 Hand of the sound.

virtual bool couples_in_team (ID team, std::list< ID > *couples)=0
 Couples in a team.

virtual ID team_of_couple (ID couple)=0
 Team owner of the couple.

virtual bool players_in_couple (ID couple, std::list< ID > *players)=0
 Players in a couple.

virtual ID couple_of_player (ID player)=0
 Couple owner of the player.

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

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

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

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

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

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

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

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

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

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

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

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


Detailed Description

Core interface.


Member Function Documentation

virtual bool dmn::Core::classification_of_tournament ID  tournament,
std::list< ID > *  teams
[pure 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

Implemented in dmn::CoreStandard.

virtual ID dmn::Core::couple_of_player ID  player  )  [pure virtual]
 

Couple owner of the player.

Parameters:
player identificator of the player
Returns:
DMN_ID_NULL if the player not exist or the identificator of the couple

Implemented in dmn::DB.

virtual bool dmn::Core::couples_in_game ID  game,
std::list< ID > *  couples
[pure virtual]
 

Couples in a game.

If couples is NULL, nothing is returned

Parameters:
game identificator of the game
couples where to return the couples in a List_t
Returns:
true if exist the game

Implemented in dmn::DB.

virtual bool dmn::Core::couples_in_match ID  match,
std::list< ID > *  couples
[pure virtual]
 

Couples in a match.

If couples is NULL, nothing is returned

Parameters:
match identificator of the match
couples where to return the couples in a List_t
Returns:
true if exist the match

Implemented in dmn::DB.

virtual bool dmn::Core::couples_in_team ID  team,
std::list< ID > *  couples
[pure virtual]
 

Couples in a team.

If couples is NULL, nothing is returned

Parameters:
team identificator of the team
couples where to return the couples in a List_t
Returns:
true if exist the team

Implemented in dmn::DB.

virtual bool dmn::Core::displays_in_game ID  game,
std::list< ID > *  displays
[pure virtual]
 

Displays in a game.

If displays is NULL, nothing is returned

Parameters:
game identificator of the game
displays where to return the displays in a List_t
Returns:
true if exist the game

Implemented in dmn::DB.

virtual bool dmn::Core::displays_in_hand ID  hand,
std::list< ID > *  displays
[pure virtual]
 

Displays in a hand.

If displays is NULL, nothing is returned

Parameters:
hand identificator of the hand
displays where to return the displays in a List_t
Returns:
true if exist the hand

Implemented in dmn::DB.

virtual bool dmn::Core::displays_in_match ID  match,
std::list< ID > *  displays
[pure virtual]
 

Displays in a match.

If displays is NULL, nothing is returned

Parameters:
match identificator of the match
displays where to return the displays in a List_t
Returns:
true if exist the match

Implemented in dmn::DB.

virtual bool dmn::Core::displays_in_tournament ID  tournament,
std::list< ID > *  displays
[pure virtual]
 

Displays in a tournament.

If displays is NULL, nothing is returned

Parameters:
tournament identificator of the tournament
displays where to return the displays in a List_t
Returns:
true if exist the tournament

Implemented in dmn::DB.

virtual bool dmn::Core::domino_playable_in_hand ID  hand,
Player player,
ID  id,
Domino  domino,
HalfDomino  half
[pure 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

Implemented in dmn::CoreStandard.

virtual int dmn::Core::dominoes_has_player_in_hand ID  hand,
ID  player
[pure 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)

Implemented in dmn::CoreStandard.

virtual int dmn::Core::dominoes_in_hand ID  hand,
Dominoes dominoes
[pure 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

Implemented in dmn::CoreStandard.

virtual ID dmn::Core::game_of_couple ID  couple  )  [pure virtual]
 

Game of the couple.

Parameters:
couple identificator of the couple
Returns:
DMN_ID_NULL if the couple not exist or the identificator of the game

Implemented in dmn::DB.

virtual ID dmn::Core::game_of_display ID  display  )  [pure virtual]
 

Game of the display.

Parameters:
display identificator of the display
Returns:
DMN_ID_NULL if the display not exist or the identificator of the game

Implemented in dmn::DB.

virtual ID dmn::Core::game_of_hand ID  hand  )  [pure virtual]
 

Game owner of the hand.

Parameters:
hand identificator of the hand
Returns:
DMN_ID_NULL if the hand not exist or the identificator of the game

Implemented in dmn::DB.

virtual bool dmn::Core::games_in_match ID  match,
std::list< ID > *  games
[pure virtual]
 

Games in a match.

If games is NULL, nothing is returned

Parameters:
match identificator of the match
games where to return the games in a List_t
Returns:
true if exist the match

Implemented in dmn::DB.

virtual ID dmn::Core::hand_of_display ID  display  )  [pure virtual]
 

Hand of the display.

Parameters:
display identificator of the display
Returns:
DMN_ID_NULL if the display not exist or the identificator of the hand

Implemented in dmn::DB.

virtual ID dmn::Core::hand_of_player ID  player  )  [pure virtual]
 

Hand of the player.

Parameters:
player identificator of the player
Returns:
DMN_ID_NULL if the player not exist or the identificator of the hand

Implemented in dmn::DB.

virtual ID dmn::Core::hand_of_sound ID  sound  )  [pure virtual]
 

Hand of the sound.

Parameters:
sound identificator of the sound
Returns:
DMN_ID_NULL if the sound not exist or the identificator of the hand

Implemented in dmn::DB.

virtual bool dmn::Core::hands_in_game ID  game,
std::list< ID > *  hands
[pure virtual]
 

Hands in a game.

If hands is NULL, nothing is returned

Parameters:
game identificator of the game
hands where to return the hands in a List_t
Returns:
true if exist the game

Implemented in dmn::DB.

virtual bool dmn::Core::is_first_hand_of_game ID  game,
ID  hand
[pure 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

Implemented in dmn::CoreStandard.

virtual bool dmn::Core::is_player_interactive ID  player  )  [pure virtual]
 

Check if a player is interactive or not.

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

Implemented in dmn::CoreStandard.

virtual ID dmn::Core::match_of_couple ID  couple  )  [pure virtual]
 

Match of the couple.

Parameters:
couple identificator of the couple
Returns:
DMN_ID_NULL if the couple not exist or the identificator of the match

Implemented in dmn::DB.

virtual ID dmn::Core::match_of_display ID  display  )  [pure virtual]
 

Match of the display.

Parameters:
display identificator of the display
Returns:
DMN_ID_NULL if the display not exist or the identificator of the match

Implemented in dmn::DB.

virtual ID dmn::Core::match_of_game ID  game  )  [pure virtual]
 

Match owner of the game.

Parameters:
game identificator of the game
Returns:
DMN_ID_NULL if the game not exist or the identificator of the match

Implemented in dmn::DB.

virtual bool dmn::Core::matches_in_tournament ID  tournament,
std::list< ID > *  matches
[pure virtual]
 

Matches in a tournament.

If matches is NULL, nothings is returned

Parameters:
tournament identificator of the tournament
matches where to return the matches in a List_t
Returns:
true if exist the tournament

Implemented in dmn::DB.

virtual HalfDomino dmn::Core::max_half_value_in_hand ID  hand  )  [pure 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

Implemented in dmn::CoreStandard.

virtual int dmn::Core::number_dominoes_in_hand ID  hand  )  [pure virtual]
 

Number of dominoes that has the hand.

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

Implemented in dmn::CoreStandard.

virtual bool dmn::Core::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
[pure 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

Implemented in dmn::CoreStandard.

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

Player's name.

Parameters:
player identificator of the player
Returns:
the name

Implemented in dmn::CoreStandard.

virtual ID dmn::Core::player_who_started_in_hand ID  hand  )  [pure virtual]
 

Player who started the hand.

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

Implemented in dmn::CoreStandard.

virtual bool dmn::Core::players_in_couple ID  couple,
std::list< ID > *  players
[pure virtual]
 

Players in a couple.

If players is NULL, nothing is returned

Parameters:
couple identificator of the couple
players where to return the players in a List_t
Returns:
true if exist the couple

Implemented in dmn::DB.

virtual bool dmn::Core::players_in_hand ID  hand,
std::list< ID > *  players
[pure virtual]
 

Players in a hand.

If players is NULL, nothing is returned

Parameters:
hand identificator of the hand
players where to return the players in a List_t
Returns:
true if exist the hand

Implemented in dmn::DB.

virtual void dmn::Core::score_board_game ID  game,
std::list< Score > *  score
[pure 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

Implemented in dmn::CoreStandard.

virtual void dmn::Core::score_board_match ID  match,
std::list< Score > *  score
[pure 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

Implemented in dmn::CoreStandard.

virtual bool dmn::Core::sounds_in_hand ID  hand,
std::list< ID > *  sounds
[pure virtual]
 

Sounds in a hand.

If sounds is NULL, nothing is returned

Parameters:
hand identificator of the hand
sounds where to return the sounds in a List_t
Returns:
true if exist the hand

Implemented in dmn::DB.

virtual ID dmn::Core::team_of_couple ID  couple  )  [pure virtual]
 

Team owner of the couple.

Parameters:
couple identificator of the couple
Returns:
DMN_ID_NULL if the couple not exist or the identificator of the team

Implemented in dmn::DB.

virtual bool dmn::Core::teams_in_tournament ID  tournament,
std::list< ID > *  teams
[pure virtual]
 

Teams in a tournament.

If teams is NULL, nothing is returned

Parameters:
tournament identificator of the tournament
teams where to return the teams in a List_t
Returns:
true if exist the tournament

Implemented in dmn::DB.

virtual ID dmn::Core::tournament_of_display ID  display  )  [pure virtual]
 

Tournament of the display.

Parameters:
display identificator of the display
Returns:
DMN_ID_NULL if the display not exist or the identificator of the tournament

Implemented in dmn::DB.

virtual ID dmn::Core::tournament_of_match ID  match  )  [pure virtual]
 

Tournament owner of the match.

Parameters:
match identificator of the match
Returns:
DMN_ID_NULL if the match not exist or the identificator of the tournament

Implemented in dmn::DB.

virtual ID dmn::Core::tournament_of_team ID  team  )  [pure virtual]
 

Tournament of the team.

Parameters:
team identificator of the team
Returns:
DMN_ID_NULL if the team not exist or the identificator of the tournament

Implemented in dmn::DB.

virtual bool dmn::Core::tournaments std::list< ID > *  tournaments  )  [pure virtual]
 

Tournaments in dmn.

If tournaments is NULL, nothings is returned

Parameters:
tournaments where to return the tournaments in a List_t
Returns:
true if there are some tournament

Implemented in dmn::DB.


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