Advanced Strategic Command
guifunctions-interface.h
Go to the documentation of this file.
1 // $Id: guifunctions-interface.h,v 1.5 2010-03-07 19:52:44 mbickel Exp $
2 //
3 /*
4  This file is part of Advanced Strategic Command; http://www.asc-hq.de
5  Copyright (C) 1994-2010 Martin Bickel and Marc Schellenberger
6 
7  This program is free software; you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation; either version 2 of the License, or
10  (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; see the file COPYING. If not, write to the
19  Free Software Foundation, Inc., 59 Temple Place, Suite 330,
20  Boston, MA 02111-1307 USA
21 */
22 
23 #if defined(karteneditor) && !defined(pbpeditor)
24 #error the mapeditor is not supposed the gui icons !
25 #endif
26 
27 
28 #ifndef guifunctionsinterfaceH
29 #define guifunctionsinterfaceH
30 
31 #include "guiiconhandler.h"
32 
33 class AStar3D;
34 
35 namespace GuiFunctions {
36 
37 class MovementBase : public GuiFunction {
38  protected:
39  virtual void parametrizePathFinder( AStar3D& pathFinder ) {};
40  virtual int getVerticalDirection() = 0;
41  public:
42  void execute( const MapCoordinate& pos, ContainerBase* subject, int num );
43  bool available( const MapCoordinate& pos, ContainerBase* subject, int num );
44 };
45 
46 class Movement : public MovementBase
47 {
48  protected:
49  virtual void parametrizePathFinder( AStar3D& pathFinder );
50  public:
51  bool checkForKey( const SDL_KeyboardEvent* key, int modifier, int num );
52  Surface& getImage( const MapCoordinate& pos, ContainerBase* subject, int num );
53  ASCString getName( const MapCoordinate& pos, ContainerBase* subject, int num );
54  int getVerticalDirection() { return 0; };
55  bool available( const MapCoordinate& pos, ContainerBase* subject, int num );
56 };
57 
58 
59 class Cancel : public GuiFunction
60 {
61  public:
62  bool available( const MapCoordinate& pos, ContainerBase* subject, int num );
63  void execute( const MapCoordinate& pos, ContainerBase* subject, int num );
64  bool checkForKey( const SDL_KeyboardEvent* key, int modifier, int num );
65  Surface& getImage( const MapCoordinate& po, ContainerBase* subject, int nums );
66  ASCString getName( const MapCoordinate& pos, ContainerBase* subject, int num );
67 };
68 
69 }
70 
71 #endif
72 
bool checkForKey(const SDL_KeyboardEvent *key, int modifier, int num)
The ASCString class provides an abstract way to manipulate strings.
Definition: ascstring.h:14
Coordinate on the twodimensional map.
Definition: typen.h:202
bool available(const MapCoordinate &pos, ContainerBase *subject, int num)
virtual void parametrizePathFinder(AStar3D &pathFinder)
Surface & getImage(const MapCoordinate &po, ContainerBase *subject, int nums)
ASCString getName(const MapCoordinate &pos, ContainerBase *subject, int num)
void execute(const MapCoordinate &pos, ContainerBase *subject, int num)
bool available(const MapCoordinate &pos, ContainerBase *subject, int num)
bool available(const MapCoordinate &pos, ContainerBase *subject, int num)
void execute(const MapCoordinate &pos, ContainerBase *subject, int num)
virtual int getVerticalDirection()=0
A 3D path finding algorithm, based on the 2D algorithm by Amit J. Patel.
Definition: astar2.h:19
The parent class of Vehicle and Building; The name Container originates from Battle Isle...
Definition: containerbase.h:40
virtual void parametrizePathFinder(AStar3D &pathFinder)
Surface & getImage(const MapCoordinate &pos, ContainerBase *subject, int num)
ASCString getName(const MapCoordinate &pos, ContainerBase *subject, int num)
bool checkForKey(const SDL_KeyboardEvent *key, int modifier, int num)