Advanced Strategic Command
gamedlg.cpp
Go to the documentation of this file.
1 
4 /*
5  This file is part of Advanced Strategic Command; http://www.asc-hq.de
6  Copyright (C) 1994-2010 Martin Bickel and Marc Schellenberger
7 
8  This program is free software; you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation; either version 2 of the License, or
11  (at your option) any later version.
12 
13  This program is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with this program; see the file COPYING. If not, write to the
20  Free Software Foundation, Inc., 59 Temple Place, Suite 330,
21  Boston, MA 02111-1307 USA
22 */
23 
24 #include <stdio.h>
25 #include <cstring>
26 #include <ctype.h>
27 #include <stdlib.h>
28 #include <math.h>
29 
30 #if TIME_WITH_SYS_TIME
31 # include <sys/time.h>
32 # include <time.h>
33 #else
34 # if HAVE_SYS_TIME_H
35 # include <sys/time.h>
36 # else
37 # include <time.h>
38 # endif
39 #endif
40 
41 
42 #include "vehicletype.h"
43 #include "buildingtype.h"
44 
45 #include "basegfx.h"
46 #include "gamedlg.h"
47 #include "stack.h"
48 #include "controls.h"
49 #include "gameoptions.h"
50 #include "errors.h"
51 #include "viewcalculation.h"
52 #include "itemrepository.h"
53 #include "strtmesg.h"
54 #include "dialogs/editmapparam.h"
55 #include "dlg_box.h"
56 #include "spfst.h"
57 #include "dialog.h"
59 #include "widgets/textrenderer.h"
60 #include "sg.h"
61 #include "spfst-legacy.h"
62 
63 
64  class ttributepayments : public tdialogbox {
66  int oldplayer;
67  int player;
68  void paintactplayer ( void );
69  void paintvalues ( void );
70  int status;
71  int players[8];
72  int wind1y, wind2y ;
73  int wind1x, wind2x ;
74 
75  public:
76  void init ( void );
77  void buttonpressed ( int id );
78  void run ( void );
79  };
80 
81 
83 {
84  int i;
85 
87  oldplayer = -1;
88  player = 0;
89  status = 0;
90  xsize = 550;
91  ysize = 400;
92  title = "transfer resources";
93 
94  trib = actmap->tribute;
95 
96  memset ( &players, -1, sizeof( players ));
97 
99 
100  addbutton ( "~O~k", 10, ysize - 40, xsize/2 - 5, ysize - 10, 0, 1, 1, true );
101  addkey ( 1, ct_enter );
102 
103  addbutton ( "~C~ancel", xsize/2 + 5, ysize - 40, xsize-10 - 5, ysize - 10, 0, 1, 2, true );
104  addkey ( 2, ct_esc );
105 
106  wind1y = starty + 10;
107 
108 
109 
110  buildgraphics();
111 
112  for (i = 0; i < 3; i++)
113  addbutton ( NULL, 250, wind1y + 15 + i * 40, 350, wind1y + 32 + i * 40, 2, 1, 3 + i, true );
114 
115  int pos = 0;
116  for ( i = 0; i < 8; i++ )
117  if ( actmap->player[i].exist() )
118  if ( i != actmap->actplayer )
119  players[pos++] = i;
120 
121 
124  activefontsettings.length = 145 - 55;
127 
128  for ( i = 0; i < pos; i++) {
129  bar ( x1 + 30, y1 + starty + 30 + i * 30, x1 + 50, y1 + starty + 50 + i * 30, 20 + players[i] * 8 );
130  showtext2 ( actmap->player[players[i]].getName().c_str(), x1 + 55, y1 + starty + 30 + i * 30 );
131  }
132 
133  wind2y = starty + ( ysize - starty - 60 ) /2 + 5;
134 
135  wind1x = 255 ;
136  wind2x = 375 ;
137 
138  rahmen ( true, x1 + 10, y1 + starty, x1 + xsize - 10, y1 + ysize - 50 );
139  rahmen3 ( "player", x1 + 20, y1 + starty + 10, x1 + 150, y1 + ysize - 60, 1 );
140 
141  rahmen3 ( "you send", x1 + 160, y1 + wind1y, x1 + wind2x - 10, y1 + wind2y - 10, 1 );
142  rahmen3 ( "you still have outstanding", x1 + 160, y1 + wind2y, x1 + wind2x - 10, y1 + ysize - 60 , 1 );
143 
144  rahmen3 ( "you have sent", x1 + wind2x - 5, y1 + wind1y, x1 + xsize - 20, y1 + wind2y - 10, 1 );
145  rahmen3 ( "you got", x1 + wind2x - 5, y1 + wind2y, x1 + xsize - 20, y1 + ysize - 60 , 1 );
146 
147 
153 
154  for ( i = 0; i < 3; i++) {
155  showtext2 ( resourceNames[i], x1 + 170, y1 + wind1y + 15 + i * 40 );
156  showtext2 ( resourceNames[i], x1 + 170, y1 + wind2y + 15 + i * 40 );
157 
158  rectangle ( x1 + wind2x, y1 + wind1y + 15 + i * 40, x1 + xsize - 30 , y1 + wind1y + 32 + i * 40, black );
159  rectangle ( x1 + wind1x, y1 + wind2y + 15 + i * 40, x1 + wind2x - 15, y1 + wind2y + 32 + i * 40, black );
160  rectangle ( x1 + wind2x, y1 + wind2y + 15 + i * 40, x1 + xsize - 30 , y1 + wind2y + 32 + i * 40, black );
161  } /* endfor */
162 
163  paintactplayer();
164  paintvalues();
165 }
166 
167 void ttributepayments :: paintactplayer ( void )
168 {
169  int xx1 = x1 + 25;
170  int xx2 = x1 + 145;
171  int yy1 = y1 + starty + 25 + oldplayer * 30;
172  int yy2 = yy1 + 30;
173  if ( oldplayer != -1 )
174  xorrectangle ( xx1, yy1, xx2, yy2, 14 );
175 
176  yy1 = y1 + starty + 25 + player * 30;
177  yy2 = yy1 + 30;
178  if ( player != -1 )
179  xorrectangle ( xx1, yy1, xx2, yy2, 14 );
180 
181  oldplayer = player;
182 }
183 
184 void ttributepayments :: paintvalues ( void )
185 {
191 
192  for ( int i = 0; i < 3; i++) {
193  addeingabe ( 3+i, &trib.avail[actmap->actplayer][players[player]].resource(i), 0, maxint );
194  enablebutton ( 3+i );
195 
196  activefontsettings.length = xsize - 40 - wind2x;
197  showtext2 ( strrr ( trib.paid[actmap->actplayer][players[player]].resource(i)), x1 + wind2x + 5, y1 + wind2y + 16 + i * 40 );
198  showtext2 ( strrr ( trib.paid[players[player]][actmap->actplayer].resource(i)), x1 + wind2x + 5, y1 + wind1y + 16 + i * 40 );
199 
200  activefontsettings.length = wind2x - wind1x - 35;
201  showtext2 ( strrr ( trib.avail[players[player]][actmap->actplayer].resource(i)), x1 + wind1x + 5, y1 + wind2y + 16 + i * 40 );
202  } /* endfor */
203 }
204 
205 
207 {
209  if ( id == 1 )
210  status = 11;
211  if ( id == 2 )
212  status = 10;
213 }
214 
216 {
217  mousevisible(true);
218  do {
219  tdialogbox::run();
220  if ( taste == ct_down ) {
221  player++;
222  if ( players[ player ] == -1 )
223  player = 0;
224  }
225  if ( taste == ct_up ) {
226  player--;
227  if ( player < 0 )
228  player = 7;
229  while ( players[ player] == -1 )
230  player--;
231  }
232  if ( mouseparams.taste & 1 )
233  for (int i = 0; i < 8; i++) {
234  if ( (mouseparams.x >= x1 + 25) &&
235  (mouseparams.y >= y1 + starty + 25 + i * 30) &&
236  (mouseparams.x <= x1 + 145) &&
237  (mouseparams.y <= y1 + starty + 55 + i * 30 ) )
238  if ( players[i] != -1 )
239  player = i;
240 
241  } /* endfor */
242 
243  if ( player != oldplayer ) {
244  paintactplayer();
245  paintvalues();
246  }
247 
248  } while ( status < 10 ); /* enddo */
249 
250  if ( status >= 11 )
251  actmap->tribute = trib;
252 }
253 
254 
255 void settributepayments ( void )
256 {
257  ttributepayments tpm;
258  tpm.init();
259  tpm.run();
260  tpm.done();
261 }
262 
263 
264 class tresearchinfo: public tdialogbox {
265  protected:
266  int rppt; // researchpoints per turn
267  int status;
268 
269 
270 
271  public:
272  tresearchinfo ( void );
273  void init ( void );
274  void buttonpressed ( int id );
275  void run ( void );
276 
277  };
278 
280 {
281  rppt = 0;
282  status = 0;
283 }
284 
285 void tresearchinfo::init ( void )
286 {
288  x1 = -1;
289  y1 = -1;
290  xsize = 500;
291  ysize = 400;
292  title = "research";
293  addbutton ( "~O~K", 10, ysize - 30, xsize - 10, ysize - 10, 0, 1, 1, true );
294  addkey( 1, ct_enter );
295  addkey( 1, ct_esc );
296  buildgraphics();
298  rahmen ( true, x1 + 19, y1 + 69, x1 + xsize - 19, y1 + 91 );
299  bar ( x1 + 20, y1 + 70, x1 + xsize - 20, y1 + 90, dblue );
300 
306 
307  int textxpos = x1 + xsize / 2 - 5 - activefontsettings.length;
308 
309  showtext2 ( "name:", textxpos, y1 + 110 );
310  showtext2 ( "research points:", textxpos, y1 + 140 );
311  showtext2 ( "research points done:", textxpos, y1 + 170 );
312  showtext2 ( "research points still needed:", textxpos, y1 + 200 );
313  showtext2 ( "research done ( % ):", textxpos, y1 + 230 );
314  showtext2 ( "research points / turn:", textxpos, y1 + 260 );
315  showtext2 ( "time left (turns):", textxpos, y1 + 290 );
316 
317 
320  textxpos = x1 + xsize / 2 + 5 ;
323 
324 
328  showtext2 ( strrr ( rp ), textxpos, y1 + 140 );
329  showtext2 ( strrr ( prog ), textxpos, y1 + 170 );
330  showtext2 ( strrr ( rp - prog ), textxpos, y1 + 200 );
331  if ( rp )
332  showtext2 ( strrr ( 100 * prog / rp ), textxpos, y1 + 230 );
333  if ( rppt )
335 
336  }
337  showtext2 ( strrr ( rppt ), textxpos, y1 + 260 );
338 
339 
340 }
341 
343 {
344  if ( id == 1 )
345  status = 10;
346 }
347 
348 void tresearchinfo::run ( void )
349 {
350  mousevisible(true);
351  do {
352  tdialogbox::run();
353  } while ( status < 10 ); /* enddo */
354 }
355 
356 
357 void researchinfo ( void )
358 { {
359  tresearchinfo ri;
360  ri.init();
361  ri.run();
362  ri.done();
363  }
364  {
365  vector<ASCString> sv;
366  for ( vector<int>::iterator i = actmap->player[actmap->actplayer].research.developedTechnologies.begin(); i != actmap->player[actmap->actplayer].research.developedTechnologies.end(); ++i ) {
367  Technology* t = technologyRepository.getObject_byID( *i );
368  if ( t )
369  sv.push_back ( t->name );
370  }
371  sort ( sv.begin(), sv.end() );
372 
373  ASCString s;
374  for ( vector<ASCString>::iterator i = sv.begin(); i != sv.end(); ++i )
375  s += *i + "\n";
376 
377 
378  ViewFormattedText vft ( "Developed Technologies", s, PG_Rect( -1, -1, 500, 500 ));
379  vft.Show();
380  vft.RunModal();
381 
382  }
383  if ( skeypress( ct_lshift)) {
385 
386  ViewFormattedText vft ( "Triggered TechAdapter", s, PG_Rect( -1, -1, 500, 500 ));
387  vft.Show();
388  vft.RunModal();
389  }
390 
391 }
392 
393 
394 
395 
396 
397 class tchoosetechlevel : public tdialogbox {
398  protected:
399  int techlevel;
400  int ok;
401  public:
402  void init ( void );
403  void buttonpressed ( int id );
404  void run ( void );
405  };
406 
408 {
409  tdialogbox :: init ( );
410  title = "choose techlevel";
411  xsize = 200;
412  ysize = 150;
413  techlevel = 0;
414  ok = 0;
415 
416  addbutton ( "~O~k", 10, ysize - 30, xsize - 10, ysize - 10 , 0, 1, 1, true );
417  addkey ( 1, ct_enter );
418 
419  addbutton ( "", 10, 60, xsize - 10, 85 , 2, 1, 2, true );
420  addeingabe ( 2, &techlevel, 0, 255 );
421  addkey ( 1, ct_space );
422 
423  buildgraphics();
424 }
425 
427 {
429  if ( id == 1 )
430  ok = 1;
431 }
432 
434 {
435  mousevisible ( true );
436  do {
437  tdialogbox::run();
438  } while ( !ok );
439  if ( techlevel > 0 )
440  for ( int i = 0; i < 8; i++ )
442 
443 };
444 
445 void choosetechlevel ( void )
446 {
447  tchoosetechlevel ctl;
448  ctl.init();
449  ctl.run();
450  ctl.done();
451 }
452 
453 
454 
455 #undef linelength
456 
457 
458 
460 {
461  ASCString s = "The game has been set up with the following game parameters:\n";
462  s += "(black line: parameter has default value)\n\n";
463  for ( int i = 0; i< gameparameternum; i++ ) {
464 
466 
467  if ( d )
468  s+= "#color4#";
469 
471  s += " = ";
472  s += strrr ( actmap->getgameparameter(GameParameter(i)) );
473 
474  if ( d )
475  s+= "#color0#";
476  s += "\n";
477  }
478  return s;
479 }
480 
482 {
483  ASCString s = writeGameParametersToString ( actmap );
484 
485  if ( actmap->getgameparameter( cgp_superVisorCanSaveMap) ) {
486  s = "#color4#Warning ! This game has been started with the option enabled that allows the Supervisor to save the map. This will allow him to spy on everything. \n"
487  "If you did not initiate this game yourself, don't play with this option unless you were specifically informed why this option had to be enabled. \n"
488  "#color0# \n" + s;
489  }
490 
491  new Message ( s, actmap, 255 );
492 }
493 
494 
495 void showGameParameters ( void )
496 {
497  ViewFormattedText vft( "Game Parameters", writeGameParametersToString(actmap), PG_Rect( -1, -1, 500, 550 ) );
498  vft.Show();
499  vft.RunModal();
500 }
501 
502 
503 
504 class tgiveunitawaydlg : public tdialogbox {
505  int markedplayer;
506  int status;
507  void paintplayer ( int i );
508  MapField* fld ;
509  int xs;
511  public:
512  void init ( MapField* fld );
513  void run ( const Context& context );
514  void buttonpressed ( int id );
515  };
516 
517 
518 void tgiveunitawaydlg :: paintplayer ( int i )
519 {
520  if ( i < 0 )
521  return;
522 
523  if ( i == markedplayer ) {
524  bar ( x1 + 20, y1 + starty + xs + i * 40, x1 + xsize - 20, y1 + starty + 60 + i * 40, 20 + receivers[i]->getPosition() * 8 );
525  } else {
526  bar ( x1 + 20, y1 + starty + xs + i * 40, x1 + xsize - 20, y1 + starty + 60 + i * 40, dblue );
527  } /* endif */
528 
532 
533  if ( receivers[i]->getPosition() < 8 )
534  showtext2 ( receivers[i]->getName().c_str(), x1 + 60, y1 + starty + xs+17 + i * 40 - activefontsettings.font->height / 2 );
535  else
536  showtext2 ( "neutral", x1 + 60, y1 + starty + xs+17 + i * 40 - activefontsettings.font->height / 2 );
537 }
538 
540 {
541  this->fld = fld;
542 
543  xs = 15;
544 
545 
546  TransferControlCommand tcc( fld->getContainer() );
547 
548  receivers = tcc.getReceivers();
549 
551 
552  xsize = 250;
553  ysize = 110 + receivers.size() * 40;
554 
555  if ( fld->vehicle )
556  title = "give unit to";
557  else if ( fld->building )
558  title = "give building to";
559 
560  addbutton ( "~O~k", 10, ysize - 30, xsize/2 - 5, ysize - 10 , 0, 1, 1, true );
561  addkey ( 1, ct_enter );
562  addbutton ( "~C~ancel", xsize/2 + 5, ysize - 30, xsize-10 - 5, ysize - 10 , 0, 1, 2, true );
563  addkey ( 2, ct_esc );
564 
565 
566  if ( receivers.size() == 1 )
567  markedplayer = 0;
568  else
569  markedplayer = -1;
570 
571  status = 0;
572 
573 
574  buildgraphics();
575 
576 
577  for ( int j = 0; j < receivers.size(); j++ )
578  paintplayer( j );
579 
580 }
581 
583 {
584  if ( id == 1 ) {
585  if ( markedplayer >= 0 )
586  status = 12;
587  else
588  displaymessage ( "please select the player you want to give your unit to",1);
589  }
590 
591  if ( id == 2 )
592  status = 10;
593 }
594 
595 
596 void tgiveunitawaydlg :: run ( const Context& context )
597 {
598  if ( !receivers.size() )
599  return;
600 
601  while ( mouseparams.taste )
603 
604  mousevisible ( true );
605  do {
606  tdialogbox :: run ( );
607 
608  int old = markedplayer;
609  if ( taste == ct_up && markedplayer > 0 )
610  markedplayer --;
611 
612  if ( taste == ct_down && markedplayer < receivers.size()-1 )
613  markedplayer ++;
614 
615  if ( mouseparams.taste == 1 )
616  for ( int i = 0; i < receivers.size(); i++ )
617  if ( mouseinrect ( x1 + 20, y1 + starty + xs + i * 40, x1 + xsize - 20, y1 + starty + 60 + i * 40 ) )
618  markedplayer = i;
619 
620 
621  if ( old != markedplayer ) {
622  paintplayer ( markedplayer );
623  paintplayer ( old );
624  }
625  } while ( status < 10 ); /* enddo */
626 
627  if ( status == 12 ) {
628  auto_ptr<TransferControlCommand> tcc ( new TransferControlCommand( fld->getContainer() ));
629  tcc->setReceiver( receivers[markedplayer] );
630  ActionResult res = tcc->execute( context );
631  if ( res.successful() )
632  tcc.release();
633  else {
634  displayActionError(res );
635  }
636  }
637 }
638 
639 void giveunitaway ( MapField* fld, const Context& context )
640 {
641  ContainerBase* c = fld->getContainer();
642  if ( !c ) {
643  dispmessage2( 450, NULL );
644  return;
645  }
646 
647  if ( c->getOwner() != c->getMap()->actplayer ) {
648  dispmessage2( 451, NULL );
649  return;
650  }
651 
652  if ( TransferControlCommand::avail( c ) ) {
653  tgiveunitawaydlg gua;
654  gua.init ( fld );
655  gua.run ( context );
656  gua.done ();
657  } else {
658  dispmessage2( 450, NULL );
659  while ( mouseparams.taste )
661 
662  }
663 }
664 
666 {
667  ASCString text;
668 
669  int p = actmap->actplayer;
670  for ( int i = 0; i < 8; i++ ) {
671  if ( actmap->player[p].exist() && actmap->player[p].playTime.size() ) {
672  text += actmap->player[p].getName();
673  text += " completed turn no. ";
674  text += strrr(actmap->player[p].playTime.rbegin()->turn);
675  text += " using ASC ";
676  text += getVersionString( actmap->player[p].ASCversion );
677  text += "\non ";
678  text += asctime ( localtime ( &actmap->player[p].playTime.rbegin()->date));
679  text += "\n";
680  }
681 
682 
683  ++p;
684  if ( p >= 8 )
685  p = 0;
686  }
687 
688  ViewFormattedText vft( "Play Time Information", text, PG_Rect( -1, -1 , 500, 400 ));
689  vft.Show();
690  vft.RunModal();
691 }
692 
693 void displaywindspeed( void )
694 {
695 #ifdef WEATHERGENERATOR
696  displaymessage2("wind speed is %d which equals %s fields / turn", actmap->weatherSystem->getCurrentWindSpeed(), strrrd8d ( actmap->weatherSystem->getCurrentWindSpeed() * maxwindspeed / 256 ));
697 #else
698  displaymessage2("wind speed is %d which equals %s fields / turn", actmap->weather.windSpeed, strrrd8d ( actmap->weather.windDirection * maxwindspeed / 256 ));
699 #endif
700 }
701 
void buttonpressed(int id)
Definition: gamedlg.cpp:342
tfontsettings activefontsettings
Definition: newfont.cpp:51
#define dblue
Definition: misc.h:33
Uint8 background
Definition: newfont.h:171
The (base-) classes which are thrown as exceptions.
int x1
Definition: dlg_box.h:40
void showPlayerTime()
Definition: gamedlg.cpp:665
void init(void)
Definition: gamedlg.cpp:285
map accessing and usage routines used by ASC and the mapeditor
void run(void)
Definition: gamedlg.cpp:433
Vehicle * vehicle
Definition: mapfield.h:89
const int gameparameternum
The number of game paramters that can be specified for each map.
Definition: gamemap.h:75
char * strrrd8d(int l)
Definition: dlg_box.cpp:73
int currentTechAvailableIn() const
Definition: research.cpp:908
int y1
Definition: dlg_box.h:40
virtual void run(void)
Definition: dlg_box.cpp:1477
void xorrectangle(int x1, int y1, int x2, int y2, Uint8 color)
draws a simple rectangle on the screen, but performs a XOR operation between the pixel already on scr...
Definition: basegfx.cpp:313
ASCString getName() const
returns the name of the player
Definition: player.cpp:274
void rahmen3(const char *txt, int x1, int y1, int x2, int y2, int style)
Definition: dlg_box.cpp:1718
virtual void buttonpressed(int id)
Definition: dlg_box.cpp:369
int getOwner() const
returns the number of the player this vehicle/building belongs to
int starty
Definition: dlg_box.h:158
vector< int > developedTechnologies
Definition: research.h:183
int xsize
Definition: dlg_box.h:40
void rahmen(bool invers, int x1, int y1, int x2, int y2)
Definition: dlgraph.cpp:97
void buildgraphics(void)
Definition: dlg_box.cpp:1180
pfont smallarial
Definition: spfst-legacy.h:28
#define ct_enter
Definition: keysymbols.h:51
Resources avail[8][8]
Definition: gamemap.h:339
Uint8 justify
Definition: newfont.h:176
Sint16 height
Definition: newfont.h:154
#define lefttext
Definition: newfont.h:184
ContainerBase * getContainer()
returns a pointer to the ContainerBase of the field or NULL if there is none
Definition: mapfield.cpp:331
Interface for some basic classes from which all of ASC's dialogs are derived.
a single field of the map
Definition: mapfield.h:26
#define ct_space
Definition: keysymbols.h:30
Resources paid[8][8]
Definition: gamemap.h:340
struct GameMap::Weather weather
ItemRepositoryLoader< Technology > technologyRepository("technology")
Uint8 color
Definition: newfont.h:170
The ASCString class provides an abstract way to manipulate strings.
Definition: ascstring.h:14
void run(const Context &context)
Definition: gamedlg.cpp:596
void dispmessage2(const ActionResult &result)
Definition: dialog.cpp:466
Uint8 taste
Definition: events.h:95
tkey taste
Definition: dlg_box.h:88
void init(MapField *fld)
Definition: gamedlg.cpp:539
void sendGameParameterAsMail(GameMap *actmap)
Definition: gamedlg.cpp:481
const int black
Definition: basegfx.h:87
void giveunitaway(MapField *fld, const Context &context)
Definition: gamedlg.cpp:639
int ysize
Definition: dlg_box.h:40
tresearchinfo(void)
Definition: gamedlg.cpp:279
Interface for various global functions and variables.
void init(void)
Definition: gamedlg.cpp:82
pfont font
Definition: newfont.h:169
void displaywindspeed(void)
Definition: gamedlg.cpp:693
int mouseinrect(int x1, int y1, int x2, int y2)
Definition: events.cpp:108
Schriften schriften
Definition: spfst.cpp:66
#define ct_lshift
Definition: keysymbols.h:32
void done(void)
Definition: dlg_box.cpp:1235
vector< const Player * > Receivers
char * strrr(int a)
converts a to a string.
Definition: misc.cpp:66
int windowstyle
Definition: dlg_box.h:163
class GameMap::ResourceTribute tribute
const Technology * activetechnology
the technology that is currently being researched
Definition: research.h:191
static bool avail(const ContainerBase *item)
GameParameterSettings gameParameterSettings[gameparameternum]
Definition: gamemap.cpp:2258
void displaymessage(const char *formatstring, int num,...)
displays a dialog box with a message
Definition: dlg_box.cpp:1849
ASCString writeGameParametersToString(GameMap *actmap)
Definition: gamedlg.cpp:459
void showGameParameters(void)
Definition: gamedlg.cpp:495
void addbutton(const char *ltxt, int lx1, int ly1, int lx2, int ly2, int lart, int lstyle, int lid, bool enabled)
Definition: dlg_box.cpp:471
#define ct_esc
Definition: keysymbols.h:43
The interface for the buildingtype class.
Uint16 length
Definition: newfont.h:174
void bar(tmouserect rect, int color)
Definition: dlg_box.cpp:537
signed char actplayer
the player who is currently making his moves (may be human or AI)
Definition: gamemap.h:232
The tribute can not only be used to demand resources from enemies but also to transfer resources to a...
Definition: gamemap.h:337
int releasetimeslice(void)
Definition: events.cpp:209
bool successful() const
void run(void)
Definition: gamedlg.cpp:215
void addkey(int id, tkey key)
Definition: dlg_box.cpp:774
Player player[9]
Definition: gamemap.h:253
char skeypress(tkey keynr)
Definition: events.cpp:181
void buttonpressed(int id)
Definition: gamedlg.cpp:206
const char * longName
Definition: gamemap.h:124
GameParameter
Definition: gamemap.h:77
int getResearchPerTurn() const
Definition: research.cpp:896
void showtext2(const ASCString &text, int x, int y)
Definition: basegfx.cpp:1953
void settributepayments(void)
Definition: gamedlg.cpp:255
int getgameparameter(GameParameter num) const
Definition: gamemap.cpp:1047
basegfx.h is the interface for the legacy graphic routines (of which some are platform dependent)...
A Message to a player. It may either be send by another player or by the system.
Definition: messages.h:30
void displaymessage2(const char *formatstring,...)
displays a message in the status line of ASC
Interface for all the dialog boxes used by the game and the mapeditor.
Research research
the status of the scientific research
Definition: player.h:142
int & resource(int type)
Definition: typen.h:105
void run(void)
Definition: gamedlg.cpp:348
int textcolor
Definition: dlg_box.h:157
#define ct_up
Definition: keysymbols.h:122
void settechlevel(int techlevel)
Definition: research.cpp:861
Building * building
Definition: mapfield.h:102
ASCString name
Definition: research.h:137
virtual void enablebutton(int id)
Definition: dlg_box.cpp:860
#define righttext
Definition: newfont.h:186
#define dlg_in3d
Definition: dlg_box.h:33
#define maxint
Definition: typen.h:462
const char * resourceNames[3]
the names of the different resources. Redundent, as we already have Resources::name ...
Definition: typen.cpp:79
GameMap * actmap
Definition: spfst.cpp:64
void init(void)
Definition: dlg_box.cpp:314
GameMap * getMap() const
The parent class of Vehicle and Building; The name Container originates from Battle Isle...
Definition: containerbase.h:40
int researchpoints
Definition: research.h:135
void researchinfo(void)
Definition: gamedlg.cpp:357
void displayActionError(const ActionResult &result, const ASCString &additionalInfo)
Definition: dialog.cpp:2168
PlayTimeContainer playTime
The time this player ended his turns. This is very informative in email games with > 2 players to fin...
Definition: player.h:205
void buttonpressed(int id)
Definition: gamedlg.cpp:582
void choosetechlevel(void)
Definition: gamedlg.cpp:445
#define ct_down
Definition: keysymbols.h:123
Uint8 height
Definition: newfont.h:178
void mousevisible(int an)
Definition: events.cpp:75
volatile tmousesettings mouseparams
Definition: events.cpp:35
void addeingabe(int lid, void *data, int min, int max)
Definition: dlg_box.cpp:833
int progress
Definition: research.h:189
Interface for a small general-purpose stack (not type safe)
int ASCversion
the version of ASC that this player has used to make his last turn
Definition: player.h:196
void buttonpressed(int id)
Definition: gamedlg.cpp:426
const char * getVersionString()
Definition: strtmesg.cpp:32
bool exist() const
does the player exist at all
Definition: player.cpp:313
void rectangle(int x1, int y1, int x2, int y2, Uint8 color)
draws a simple rectangl
Definition: basegfx.cpp:297
void init(void)
Definition: gamedlg.cpp:407
const char * title
Definition: dlg_box.h:162
ASCString listTriggeredTechAdapter() const
Definition: research.cpp:790
const int maxwindspeed
Wind with its maximum strength of 255 is moving this distance per turn.
Definition: typen.h:501
The map. THE central structure of ASC, which holds everything not globally available together...
Definition: gamemap.h:182