turncontrol.h

Go to the documentation of this file.
00001 
00007 /*
00008     This file is part of Advanced Strategic Command; http://www.asc-hq.de
00009     Copyright (C) 1994-2010  Martin Bickel  and  Marc Schellenberger
00010 
00011     This program is free software; you can redistribute it and/or modify
00012     it under the terms of the GNU General Public License as published by
00013     the Free Software Foundation; either version 2 of the License, or
00014     (at your option) any later version.
00015 
00016     This program is distributed in the hope that it will be useful,
00017     but WITHOUT ANY WARRANTY; without even the implied warranty of
00018     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019     GNU General Public License for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with this program; see the file COPYING. If not, write to the 
00023     Free Software Foundation, Inc., 59 Temple Place, Suite 330, 
00024     Boston, MA  02111-1307  USA
00025 */
00026 
00027 #if defined(karteneditor) 
00028 # error the mapeditor should not need to use turncontrol.h !
00029 #endif
00030 
00031 
00032 #ifndef turncontrolH
00033 #define turncontrolH
00034 
00035 #include "ascstring.h"
00036 
00037 class Player;
00038 class GameMap;
00039 class MapDisplayInterface;
00040 
00042 class NextTurnStrategy {
00043    public:
00044       virtual bool continueWhenLastPlayer() const = 0;  
00045       virtual bool authenticate( GameMap* actmap ) const = 0;
00046       virtual ~NextTurnStrategy() {};
00047 };
00048 
00049 class NextTurnStrategy_AskUser : public NextTurnStrategy {
00050    public:
00051       bool continueWhenLastPlayer() const;  
00052       bool authenticate( GameMap* actmap  ) const;  
00053 } ;
00054 
00055 class NextTurnStrategy_Abort : public NextTurnStrategy {
00056    public:
00057       bool continueWhenLastPlayer() const;
00058       bool authenticate( GameMap* actmap) const;
00059 } ;
00060 
00061 
00062 
00066 extern void next_turn ( GameMap* gameMap, const NextTurnStrategy& nextTurnStrategy, MapDisplayInterface* display, int playerView = -2 );
00067 
00069 extern void  checkforvictory ( GameMap* gamemap, bool hasTurnControl );
00070 
00071 
00073 extern GameMap* continueNetworkGame ( bool mostRecent = false );
00074 
00075 extern GameMap* continueNetworkGame ( const ASCString& filename );
00076 
00077 
00079 extern void checkUsedASCVersions( Player& currentPlayer );
00080 
00081 class AbstractPlayerProcessing {
00082    public:
00083        virtual void playerSkipped( Player& player ) = 0;
00084        virtual ~AbstractPlayerProcessing(){};
00085 };
00086     
00087 extern int findNextPlayer( GameMap* actmap, AbstractPlayerProcessing* playerProcessor = NULL );
00088 
00090 extern void skipTurn( GameMap* gamemap );
00091 
00092 
00093 
00094 #endif

Generated on Mon May 21 01:26:38 2012 for Advanced Strategic Command by  doxygen 1.5.1