1 /***************************************************************************
2 * Mechanized Assault and Exploration Reloaded Projectfile *
3 * *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 * *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, write to the *
16 * Free Software Foundation, Inc., *
17 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
18 ***************************************************************************/
19
20 #include "game/logic/turnclock.h"
21
22 //------------------------------------------------------------------------------
cTurnClock(int turn_)23 cTurnClock::cTurnClock (int turn_) :
24 turn (turn_)
25 {}
26
27 //------------------------------------------------------------------------------
getTurn() const28 int cTurnClock::getTurn() const
29 {
30 return turn;
31 }
32
33 //------------------------------------------------------------------------------
setTurn(int turn_)34 void cTurnClock::setTurn (int turn_)
35 {
36 std::swap (turn, turn_);
37 if (turn != turn_) turnChanged();
38 }
39
40 //------------------------------------------------------------------------------
increaseTurn()41 void cTurnClock::increaseTurn()
42 {
43 ++turn;
44 turnChanged();
45 }
46