initial commit, lordsawar source, slightly modified
[lordsawar] / src / NextTurnPbm.h
1 // Copyright (C) 2003, 2004, 2005, 2006 Ulf Lorenz
2 // Copyright (C) 2007, 2008 Ben Asselstine
3 // Copyright (C) 2007, 2008 Ole Laursen
4 //
5 //  This program is free software; you can redistribute it and/or modify
6 //  it under the terms of the GNU General Public License as published by
7 //  the Free Software Foundation; either version 3 of the License, or
8 //  (at your option) any later version.
9 //
10 //  This program is distributed in the hope that it will be useful,
11 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
12 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 //  GNU Library General Public License for more details.
14 //
15 //  You should have received a copy of the GNU General Public License
16 //  along with this program; if not, write to the Free Software
17 //  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 
18 //  02110-1301, USA.
19
20 #ifndef NEXT_TURN_PBM_H
21 #define NEXT_TURN_PBM_H
22
23 #include "NextTurn.h"
24
25 /**
26    \brief The class to pass turns around the players for a play-by-mail game.
27  
28  */
29
30 class NextTurnPbm: public NextTurn
31 {
32     public:
33         /**
34            \brief constructor
35
36            @param   turnmode    setting for the private variable d_turnmode
37            @param   random_turns change the order every round
38
39            @note The start_next_player means that the player->startTurn
40                  method will be called.
41          */
42         NextTurnPbm(bool turnmode, bool random_turns);
43
44         /**
45            \brief destructor
46          */
47         virtual ~NextTurnPbm();
48         
49         /**
50            \brief start a new game
51           
52            This function starts with the currently active player, or the first
53            if there is none active. For starting a game. This should be the
54            lowest of all scenario-related functions in the stack.
55          */
56         void start();
57
58         //! Interrupts the game on the next possible occasion
59         void stop() {d_stop = true;}
60         
61         /**
62            \brief go on to the next player
63            
64            This function starts the next to the active player's turn. Used when
65            a human player has pushed the next_turn button.
66          */
67         void endTurn();
68
69     private:
70         /**
71            \brief The function for all actions which are taken at the beginning
72            of a player's turn
73           */
74         void startTurn();
75         
76         /**
77            \brief The function for all actions which are taken at the end of a
78            player's turn
79          */
80         void finishTurn();
81
82         /**
83            \brief The function for all actions which are taken at the end of a
84            Game Turn.
85          */
86         void finishRound();
87
88 };
89
90 #endif //NEXT_TURN_PBM_H