Advanced Strategic Command
turncontrol.h
Go to the documentation of this file.
1 
7 /*
8  This file is part of Advanced Strategic Command; http://www.asc-hq.de
9  Copyright (C) 1994-2010 Martin Bickel and Marc Schellenberger
10 
11  This program is free software; you can redistribute it and/or modify
12  it under the terms of the GNU General Public License as published by
13  the Free Software Foundation; either version 2 of the License, or
14  (at your option) any later version.
15 
16  This program is distributed in the hope that it will be useful,
17  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  GNU General Public License for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with this program; see the file COPYING. If not, write to the
23  Free Software Foundation, Inc., 59 Temple Place, Suite 330,
24  Boston, MA 02111-1307 USA
25 */
26 
27 #if defined(karteneditor)
28 # error the mapeditor should not need to use turncontrol.h !
29 #endif
30 
31 
32 #ifndef turncontrolH
33 #define turncontrolH
34 
35 #include "ascstring.h"
36 
37 class Player;
38 class GameMap;
40 
43  public:
44  virtual bool continueWhenLastPlayer() const = 0;
45  virtual bool authenticate( GameMap* actmap ) const = 0;
46  virtual ~NextTurnStrategy() {};
47 };
48 
50  public:
51  bool continueWhenLastPlayer() const;
52  bool authenticate( GameMap* actmap ) const;
53 } ;
54 
56  public:
57  bool continueWhenLastPlayer() const;
58  bool authenticate( GameMap* actmap) const;
59 } ;
60 
61 
62 
66 extern void next_turn ( GameMap* gameMap, const NextTurnStrategy& nextTurnStrategy, MapDisplayInterface* display, int playerView = -2 );
67 
69 extern void checkforvictory ( GameMap* gamemap, bool hasTurnControl );
70 
71 
73 extern GameMap* continueNetworkGame ( bool mostRecent = false );
74 
75 extern GameMap* continueNetworkGame ( const ASCString& filename );
76 
77 
79 extern void checkUsedASCVersions( Player& currentPlayer );
80 
82  public:
83  virtual void playerSkipped( Player& player ) = 0;
85 };
86 
87 extern int findNextPlayer( GameMap* actmap, AbstractPlayerProcessing* playerProcessor = NULL );
88 
90 extern void skipTurn( GameMap* gamemap );
91 
92 
93 
94 #endif
virtual bool continueWhenLastPlayer() const =0
describes the behavier that next_turn() shall do when it finds out that the current player is the las...
Definition: turncontrol.h:42
void skipTurn(GameMap *gamemap)
skips the next player. This is for administrative use, for example if a player does not react ...
virtual void playerSkipped(Player &player)=0
virtual bool authenticate(GameMap *actmap) const =0
void checkforvictory(GameMap *gamemap, bool hasTurnControl)
checks if the current player has terminated another player or even won
The ASCString class provides an abstract way to manipulate strings.
Definition: ascstring.h:14
GameMap * continueNetworkGame(bool mostRecent=false)
continues a PBeM game; the current map is deleted
void next_turn(GameMap *gameMap, const NextTurnStrategy &nextTurnStrategy, MapDisplayInterface *display, int playerView=-2)
virtual ~AbstractPlayerProcessing()
Definition: turncontrol.h:84
bool continueWhenLastPlayer() const
bool continueWhenLastPlayer() const
virtual ~NextTurnStrategy()
Definition: turncontrol.h:46
void checkUsedASCVersions(Player &currentPlayer)
this checks if one player has been using a new ASC version than the current player. If this is the case, the current player is notified and asked to upgrade
GameMap * actmap
Definition: spfst.cpp:64
the different players in ASC. There may be 8 players (0..7) and neutral units (8) ...
Definition: player.h:99
bool authenticate(GameMap *actmap) const
bool authenticate(GameMap *actmap) const
int findNextPlayer(GameMap *actmap, AbstractPlayerProcessing *playerProcessor=NULL)
The map. THE central structure of ASC, which holds everything not globally available together...
Definition: gamemap.h:182