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

core.h

Go to the documentation of this file.
00001 
00028 #ifndef DMN_CORE_H
00029 #define DMN_CORE_H 1
00030 
00031 #include <dmn/dmn.h>
00032 #include <dmn/id.h>
00033 #include <dmn/domino.h>
00034 #include <dmn/dominoes.h>
00035 #include <dmn/module.h>
00036 #include <dmn/config.h>
00037 #include <dmn/player.h>
00038 #include <dmn/tournament.h>
00039 #include <dmn/match.h>
00040 #include <dmn/game.h>
00041 #include <dmn/hand.h>
00042 #include <dmn/display.h>
00043 #include <dmn/sound.h>
00044 
00045 #include <list>
00046 
00047 namespace dmn
00048 {
00052   class Core: public Module
00053   {
00054   public:
00058     Core();
00059 
00063     virtual ~Core() {}
00064 
00065     /**********
00066      *  Core  *
00067      **********/
00068 
00076     //  virtual bool play(const Config& display) = 0;
00077 
00091     virtual bool play(const std::list<PlayerInfo>& teams,
00092           const std::string& tournament, const std::string& match,
00093           const std::string& game, const std::string& hand,
00094           const std::string& display,
00095           const std::string& sound) = 0;
00096 
00106     virtual bool tournaments(std::list<ID> *tournaments) = 0;
00107 
00118     virtual bool matches_in_tournament(ID tournament, std::list<ID> *matches)
00119       = 0;
00120 
00129     virtual ID tournament_of_match(ID match) = 0;
00130 
00141     virtual bool teams_in_tournament(ID tournament, std::list<ID> *teams) = 0;
00142 
00151     virtual ID tournament_of_team(ID team) = 0;
00152 
00163     virtual bool displays_in_tournament(ID tournament, std::list<ID> *displays)
00164       = 0;
00165 
00174     virtual ID tournament_of_display(ID display) = 0;
00175 
00186     virtual bool games_in_match(ID match, std::list<ID> *games) = 0;
00187 
00196     virtual ID match_of_game(ID game) = 0;
00197 
00208     virtual bool couples_in_match(ID match, std::list<ID> *couples) = 0;
00209 
00218     virtual ID match_of_couple(ID couple) = 0;
00219 
00230     virtual bool displays_in_match(ID match, std::list<ID> *displays) = 0;
00231 
00240     virtual ID match_of_display(ID display) = 0;
00241 
00252     virtual bool hands_in_game(ID game, std::list<ID> *hands) = 0;
00253 
00262     virtual ID game_of_hand(ID hand) = 0;
00263 
00274     virtual bool couples_in_game(ID game, std::list<ID> *couples) = 0;
00275 
00284     virtual ID game_of_couple(ID couple) = 0;
00285 
00296     virtual bool displays_in_game(ID game, std::list<ID> *displays) = 0;
00297 
00306     virtual ID game_of_display(ID display) = 0;
00307 
00318     virtual bool players_in_hand(ID hand, std::list<ID> *players) = 0;
00319 
00328     virtual ID hand_of_player(ID player) = 0;
00329 
00340     virtual bool displays_in_hand(ID hand, std::list<ID> *displays) = 0;
00341 
00350     virtual ID hand_of_display(ID display) = 0;
00351 
00362     virtual bool sounds_in_hand(ID hand, std::list<ID>* sounds) = 0;
00363 
00372     virtual ID hand_of_sound(ID sound) = 0;
00373 
00384     virtual bool couples_in_team(ID team, std::list<ID> *couples) = 0;
00385 
00394     virtual ID team_of_couple(ID couple) = 0;
00395 
00406     virtual bool players_in_couple(ID couple, std::list<ID> *players) = 0;
00407 
00416     virtual ID couple_of_player(ID player) = 0;
00417 
00418     /****************
00419      *  Tournament  *
00420      ****************/
00421 
00430     virtual bool classification_of_tournament(ID tournament,
00431                 std::list<ID> *teams) = 0;
00432 
00433     /***********
00434      *  Match  *
00435      ***********/
00436 
00445     virtual void score_board_match(ID match, std::list<Score> *score) = 0;
00446 
00447     /***********
00448      *  Game  *
00449      ***********/
00450 
00459     virtual bool is_first_hand_of_game(ID game, ID hand) = 0;
00460 
00471     virtual void score_board_game(ID game, std::list<Score> *score) = 0;
00472 
00473     /**********
00474      *  Hand  *
00475      **********/
00476 
00484     virtual ID player_who_started_in_hand(ID hand) = 0;
00485 
00493     virtual int number_dominoes_in_hand(ID hand) = 0;
00494 
00502     virtual HalfDomino max_half_value_in_hand(ID hand) = 0;
00503 
00512     virtual int dominoes_in_hand(ID hand, Dominoes* dominoes) = 0;
00513 
00522     virtual int dominoes_has_player_in_hand(ID hand, ID player) = 0;
00523 
00535     virtual bool domino_playable_in_hand(ID hand, Player* player, ID id,
00536            Domino domino, HalfDomino half) = 0;
00537 
00538     /************
00539      *  Player  *
00540      ************/
00548     virtual const std::string player_name(ID player) = 0;
00549 
00557     virtual bool is_player_interactive(ID player) = 0;
00558   };
00559 };
00560 
00561 #endif        /* DMN_CORE_H */

Generated on Fri Dec 26 22:52:54 2003 for dmn by doxygen 1.3.4