Advanced Strategic Command
weathercast.h
Go to the documentation of this file.
1 //
2 // C++ Interface: weathercast
3 //
4 // Description:
5 //
6 //
7 // Author: Kevin Hirschmann <hirsch@dhcppc0>, (C) 2005
8 //
9 // Copyright: See COPYING file that comes with this distribution
10 //
11 //
12 #ifndef WEATHERCAST_H
13 #define WEATHERCAST_H
14 
15 #include <list>
16 #include <map>
17 #include "pgimage.h"
18 #include "paradialog.h"
19 #include "weatherarea.h"
20 #include "paradialog.h"
21 #include "dashboard.h"
27 //SDLmm::Color LRCOLOR = 700;
28 
29 struct WindAccu{
32 };
33 
34 typedef list<WindData> WindStack;
35 typedef map<const WeatherArea*, WindAccu> WeatherMap;
36 
37 
38 class WeatherPanel: public Panel{
39 public:
40 WeatherPanel ( PG_Widget *parent, const PG_Rect &r, const ASCString& panelName_, bool loadTheme = true );
41 virtual ~WeatherPanel();
43 int getCounter();
44 private:
45  int counter;
46  int windSpeed;
47 
48  PG_Button* back;
49  PG_Button* forward;
50 
51  PG_Image* windRoseImage;
52  PG_Image* windRoseArrow;
53  PG_Image* windBar;
54 
55  PG_Label* turnLabel;
56  PG_Label* windspeedLabel;
57 
58  BarGraphWidget* bgw;
59 
60  const WeatherSystem* weatherSystem;
61  WindStack windStack;
62  WeatherMap warea2WindAccu;
63  WindAccu wAccu;
64 
65 
66  bool buttonForward( PG_Button* button );
67  bool buttonBack( PG_Button* button );
68  void painter (const PG_Rect &src, const ASCString& name, const PG_Rect &dst);
69  void updateWeatherSpeed(int turn);
70 
71  void showTurn();
72  WindAccu updateWindAccu(const WindAccu&, unsigned int windspeed, Direction windDirection, float ratio);
73 };
74 
75 
76 class Weathercast: public ASC_PG_Dialog{
77 public:
78  Weathercast(const WeatherSystem& ws);
79 
80  virtual ~Weathercast();
81 
82  void painter (const PG_Rect &src, const ASCString& name, const PG_Rect &dst);
83  bool mouseButtonDown ( const SDL_MouseButtonEvent *button);
84  bool mouseMotion ( const SDL_MouseMotionEvent *motion);
85  bool mouseClick ( SPoint pos );
86  void paintWeatherArea(const WeatherArea* wa, int vMove, int hMove);
87 private:
88  static const int xSize;
89  static const int ySize;
90  static const int MAPXSIZE;
91  static const int MAPYSIZE;
92 
93 
94  WeatherPanel* weatherPanel;
95 
96  int mapYPos;
97  int mapXPos;
98 
99 
100 
101  const WeatherSystem& weatherSystem;
102 
103 
104  Surface s;
105  float currentZoomX;
106  float currentZoomY;
108  MapDisplayPG* mapDisplayWidget;
109  //PG_Image* weatherMapImage;
110  PG_Button* okButton;
111  bool closeWindow();
112  void generateWeatherMap(int turn);
113  void redraw() { Redraw(true); };
114 
115 };
116 
117 extern void weathercast();
118 
119 #endif
120 
void painter(const PG_Rect &src, const ASCString &name, const PG_Rect &dst)
virtual ~Weathercast()
WindAccu getWindAccuData(const WeatherArea *wa)
virtual ~WeatherPanel()
Definition: weathercast.cpp:58
bool mouseButtonDown(const SDL_MouseButtonEvent *button)
bool mouseMotion(const SDL_MouseMotionEvent *motion)
WeatherPanel(PG_Widget *parent, const PG_Rect &r, const ASCString &panelName_, bool loadTheme=true)
Definition: weathercast.cpp:23
The ASCString class provides an abstract way to manipulate strings.
Definition: ascstring.h:14
int verticalValue
Definition: weathercast.h:31
int horizontalValue
Definition: weathercast.h:30
void weathercast()
Adapter class for using Paragui Dialogs in ASC. This class transfers the event control from ASC to Pa...
Definition: paradialog.h:127
Dialog classes based on the Paragui library.
SDLmm::SPoint SPoint
Definition: surface.h:27
Weathercast(const WeatherSystem &ws)
Direction
Definition: weatherarea.h:84
list< WindData > WindStack
Definition: weathercast.h:34
map< const WeatherArea *, WindAccu > WeatherMap
Definition: weathercast.h:35
void paintWeatherArea(const WeatherArea *wa, int vMove, int hMove)
The box displaying unit information.
bool mouseClick(SPoint pos)