Advanced Strategic Command
viewcalculation.cpp
Go to the documentation of this file.
1 
5 /***************************************************************************
6  viewcalculation.cpp - description
7  -------------------
8  begin : Thu Oct 5 2000
9  copyright : (C) 2000 by Martin Bickel
10  email : bickel@asc-hq.org
11  ***************************************************************************/
12 
13 /***************************************************************************
14  * *
15  * This program is free software; you can redistribute it and/or modify *
16  * it under the terms of the GNU General Public License as published by *
17  * the Free Software Foundation; either version 2 of the License, or *
18  * (at your option) any later version. *
19  * *
20  ***************************************************************************/
21 
22 #include "global.h"
23 #include "viewcalculation.h"
24 #include "mapalgorithms.h"
25 
26 #include "vehicletype.h"
27 #include "buildingtype.h"
28 #include "errors.h"
29 #include "gameeventsystem.h"
30 
31 #include "actions/changeview.h"
33 
34 sigc::signal<void> buildingSeen;
35 
36 
37 void tcomputeview::initviewcalculation( int view, int jamming, int sx, int sy, int _mode, int _height ) // mode: +1 = add view ; -1 = remove view
38 {
39  height = _height;
40 
41  if ( view < 0 )
42  view = 0;
43 
44  if ( view > 255 )
45  viewdist = 255;
46  else
47  viewdist = view;
48  jamdist = jamming;
49  mode = _mode;
50 
51  int md;
52  if ( viewdist > jamdist )
53  md = viewdist / minmalq + 1;
54  else
55  md = jamdist / minmalq + 1;
56 
57  initsearch( MapCoordinate(sx, sy), md, 0 );
58 }
59 
61 {
62  int f = beeline(startPos, mc);
63  MapField* efield = gamemap->getField(mc);
64 
65  if ( viewdist && ( f <= 15 ) && (gamemap->getgameparameter( cgp_disableDirectView) == 0 || f < 10 ) )
66  efield->view[player].direct += mode;
67 
68  int str = viewdist;
69  if ( f ) {
70  int freefields = 0;
71 #if 0
72  if ( height > chhochfliegend )
73  freefields = 5;
74  else
75  if ( height == chhochfliegend )
76  freefields = 3;
77  else
78  if ( height == chfliegend )
79  freefields = 2;
80  else
81  if ( height == chtieffliegend )
82  freefields = 1;
83 #endif
84  if ( height > chhochfliegend )
86  else
87  if ( height == chhochfliegend )
89  else
90  if ( height == chfliegend )
92  else
94 
95  tdrawgettempline lne ( freefields, gamemap );
96 
97  if ( startPos.x == -1 || startPos.y == -1 )
98  fatalError("error in tcomputeview::testfield" );
99 
100  lne.start ( startPos.x, startPos.y, mc.x, mc.y );
101  str -= f;
102  str -= lne.tempsum * baseJammingMultiplier / 100;
103  }
104 
105 
106  if ( str > 0 ) {
107  efield->view[player].view += str * mode;
108 
109  if ( sonar )
110  efield->view[player].sonar += mode;
111 
112  if ( satellitenview )
113  efield->view[player].satellite += mode;
114 
115  if ( minenview )
116  efield->view[player].mine += mode;
117  }
118 
119  if ( rangeJamming || !f ) {
120  int jamloss = f * gamemap->getgameparameter ( cgp_jammingSlope ) / 10;
121  int jamstrength = jamdist * gamemap->getgameparameter ( cgp_jammingAmplifier ) / 100;
122  if ( jamstrength >= jamloss )
123  efield->view[player].jamming += (jamstrength - jamloss) * mode;
124  }
125 
126  #ifdef DEBUGVIEW
127  if ( efield->view[player].view < 0 ||
128  efield->view[player].sonar < 0 ||
129  efield->view[player].satellite < 0 ||
130  efield->view[player].jamming < 0 ||
131  efield->view[player].mine < 0 )
132  errorMessage( "Warning: inconsistency in view calculation !!\n Please report this bug !" );
133  #endif
134 }
135 
136 
137 
138 void tcomputevehicleview::init( const Vehicle* eht, int _mode ) // mode: +1 = add view ; -1 = remove view ); )
139 {
140  player = eht->getOwner();
141 
142  if ( player >= eht->getMap()->getPlayerCount() )
143  fatalError ( "ComputeVehicleView::init - invalid player ");
144 
145  if ( eht->height == chsatellit )
146  satellitenview = 1;
147  else
149 
153  rangeJamming = false;
154 
155  /*
156  if ( eht->typ->hasFunction( ContainerBaseType::DetectsMineralResources ) && _mode == 1 )
157  eht->searchForMineralResources();
158  */
159 
160  int view = eht->view+1;
161  if ( eht->height <= chfahrend) {
162  view += gamemap->getField ( eht->getPosition() )->viewbonus;
163  if ( view < 1 )
164  view = 1;
165  }
166 
167 
168  tcomputeview::initviewcalculation( view, eht->typ->jamming, eht->xpos, eht->ypos, _mode, eht->height );
169  // testfield( eht->getPosition() );
170 
171 }
172 
173 
174 
175 void tcomputebuildingview::init( const Building* bld, int _mode )
176 {
177  player = bld->getOwner();
178 
179  if ( player >= bld->getMap()->getPlayerCount() )
180  fatalError ( "ComputeBuildingView::init - invalid player ");
181 
182  int c, j ;
183 
184  if (bld->getCompletion() == bld->typ->construction_steps - 1) {
185  c = bld->view + 1;
186  if ( bld->typ->height <= chfahrend ) {
187  c += gamemap->getField ( bld->getEntry() )->viewbonus;
188  if ( c < 1 )
189  c = 1;
190  }
191  j = bld->typ->jamming;
192  } else {
193  c = 15;
194  j = 0;
195  }
196 
197  initviewcalculation( c, j, bld->getEntry().x, bld->getEntry().y, _mode, bld->typ->height );
198 
199  if ( bld->typ->height == chsatellit )
200  satellitenview = 1;
201  else
203 
207  rangeJamming = false;
208 
209  building = bld;
210 
211  for ( int a = 0; a < 4; a++)
212  for (int b = 0; b < 6; b++)
213  if ( building->typ->fieldExists ( BuildingType::LocalCoordinate( a, b ) )) {
214  MapField* efield = building->getField ( BuildingType::LocalCoordinate( a, b ) );
215  if ( minenview )
216  efield->view[player].mine += _mode;
217  efield->view[player].direct += _mode;
218  }
219 }
220 
221 
222 
223 
224 
225 void clearvisibility( GameMap* gamemap )
226 {
227  if (!gamemap || (gamemap->xsize <= 0) || (gamemap->ysize <= 0))
228  return;
229 
230  for ( int p = 0; p < gamemap->getPlayerCount() ; p++ ) {
231  for ( Player::VehicleList::iterator i = gamemap->player[p].vehicleList.begin(); i != gamemap->player[p].vehicleList.end(); i++ )
232  (*i)->resetview();
233  for ( Player::BuildingList::iterator b = gamemap->player[p].buildingList.begin(); b != gamemap->player[p].buildingList.end(); b++ )
234  (*b)->resetview();
235  }
236 
237  int l = 0;
238  for ( int x = 0; x < gamemap->xsize ; x++)
239  for ( int y = 0; y < gamemap->ysize ; y++) {
240  MapField* fld = &gamemap->field[l];
241  memset ( fld->view, 0, sizeof ( fld->view ));
242  l++;
243  }
244 
245 
246 }
247 
248 
249 VisibilityStates calcvisibilityfield ( GameMap* gamemap, MapField* fld, int player, int add, int initial, int additionalEnemyJamming )
250 {
251  if ( player == -1 )
252  return visible_all;
253 
254  if ( player <= -2 )
255  return visible_not;
256 
257  if ( gamemap->player[player].stat == Player::supervisor )
258  return visible_all;
259 
260  if ( initial == 2 )
261  return visible_all;
262 
263 
265 
266  if ( ((fld->visible >> (player * 2)) & 3) >= visible_ago || initial == 1)
267  view = visible_ago;
268 
269  if ( add == -1 )
270  add = getPlayersWithSharedViewMask( player, gamemap );
271 
272  add |= 1 << player;
273 
274  int sight = 0;
275  int jamming = 0;
276  int mine = 0;
277  int satellite = 0;
278  int direct = 0;
279  int sonar = 0;
280  for ( int i = 0; i < gamemap->getPlayerCount(); i++ ){
281  if ( add & ( 1 << i )) {
282  sight += fld->view[i].view;
283  mine += fld->view[i].mine;
284  satellite += fld->view[i].satellite;
285  direct += fld->view[i].direct;
286  sonar += fld->view[i].sonar;
287  } else
288  jamming += fld->view[i].jamming;
289  }
290 
291  if ( fld->secondvehicle )
292  direct = false;
293 
294  if ( sight > (jamming + additionalEnemyJamming ) || direct ) {
295  if (( fld->getVehicle() && ( fld->getVehicle()->getOwner() == player ) && false ) ||
296  ( fld->getVehicle() && ( fld->getVehicle()->height < chschwimmend ) && sonar ) ||
297  ( fld->building && ( fld->building->typ->height < chschwimmend ) && sonar ) ||
298  ( !fld->mines.empty() && ( mine || fld->mineowner() == player)) ||
299  ( fld->getVehicle() && ( fld->getVehicle()->height >= chsatellit ) && satellite )) {
300  return visible_all;
301  } else {
302  return visible_now;
303  }
304  } else
305  return view;
306 }
307 
308 int evaluatevisibilityfield ( GameMap* gamemap, MapField* fld, int player, int add, int initial )
309 {
310  if ( player < 0 )
311  return 0;
312 
313  int originalVisibility;
314  if ( initial == 2 ) {
315  fld->setVisibility(visible_all, player);
316  return 0;
317  } else {
318  originalVisibility = (fld->visible >> (player * 2)) & 3;
319  if ( originalVisibility >= visible_ago || initial == 1)
320  fld->setVisibility(visible_ago, player);
321  }
322 
323  VisibilityStates view = calcvisibilityfield( gamemap, fld, player, add, initial, 0 );
324  fld->setVisibility( view, player );
325  if ( view >= visible_now )
326  if ( fld->building && (fld->building->connection & cconnection_seen))
327  buildingSeen();
328  return view != originalVisibility;
329 }
330 
331 
332 int evaluateviewcalculation ( GameMap* gamemap, int player_fieldcount_mask, bool disableShareView, const Context* context )
333 {
334 
335  int initial = gamemap->getgameparameter ( cgp_initialMapVisibility );
336  int fieldsChanged = 0;
337  bool firstLoop = true;
338  for ( int player = 0; player < gamemap->getPlayerCount(); player++ )
339  if ( gamemap->player[player].exist() ) {
340  int add = 0;
341  if ( !disableShareView )
342  add += getPlayersWithSharedViewMask( player, gamemap );
343 
344  for ( int y = 0; y < gamemap->ysize; ++y )
345  for ( int x = 0; x < gamemap->xsize; ++x ) {
346  MapField* fld = gamemap->getField(x,y);
347 
348  if ( firstLoop )
349  // first player in loop, so we save the current state as the 'original' state
350  fld->setTemp3(fld->visible);
351 
352  if ( player_fieldcount_mask & (1 << player ))
353  fieldsChanged += evaluatevisibilityfield ( gamemap, fld, player, add, initial );
354  else
355  evaluatevisibilityfield ( gamemap, fld, player, add, initial );
356  }
357 
358  firstLoop = false;
359  }
360 
361  if ( context ) {
362  ChangeView::ViewState viewState;
363  for ( int y = 0; y < gamemap->ysize; ++y )
364  for ( int x = 0; x < gamemap->xsize; ++x ) {
365  MapField* fld = gamemap->getField(x,y);
366  if ( fld->visible != fld->getTemp3() ) {
367  // we are running under action control, the change shall be done by the action and not here,
368  // so we are undoing our change for the moment
369  viewState[MapCoordinate(x,y)] = fld->visible;
370  fld->visible = fld->getTemp3();
371  }
372  }
373 
374  (new ChangeView(gamemap,viewState))->execute(*context);
375  }
376 
377  return fieldsChanged;
378 }
379 
380 int evaluateviewcalculation ( GameMap* gamemap, const MapCoordinate& pos, int distance, int player_fieldcount_mask, bool disableShareView, const Context* context )
381 {
382  ChangeView::ViewState* viewState = NULL;
383  if ( context )
384  viewState = new ChangeView::ViewState();
385 
386  distance = (distance+maxmalq-1)/maxmalq;
387  int x1 = pos.x - distance;
388  if ( x1 < 0 )
389  x1 = 0;
390 
391  int y1 = pos.y - distance*2;
392  if ( y1 < 0 )
393  y1 = 0;
394 
395  int x2 = pos.x + distance;
396  if ( x2 >= gamemap->xsize )
397  x2 = gamemap->xsize-1;
398 
399  int y2 = pos.y + distance*2;
400  if ( y2 >= gamemap->ysize )
401  y2 = gamemap->ysize-1;
402 
403  int initial = gamemap->getgameparameter ( cgp_initialMapVisibility );
404  int fieldsChanged = 0;
405 
406  int add[playerNum];
407  for ( int i = 0; i < playerNum; ++i )
408  add[i] = 0;
409 
410  for ( int player = 0; player < gamemap->getPlayerCount(); player++ )
411  if ( gamemap->player[player].exist() ) {
412  if ( !disableShareView )
413  for ( int i = 0; i < gamemap->getPlayerCount(); i++ )
414  if ( gamemap->player[i].exist() && i != player )
415  if ( gamemap->player[i].diplomacy.sharesView( player) )
416  add[player] |= 1 << i;
417  }
418 
419 
420  for ( int yy = y1; yy <= y2; yy++ )
421  for ( int xx = x1; xx <= x2; xx++ ) {
422  MapField* fld = gamemap->getField ( xx, yy );
423  int oldview = fld->visible;
424  for ( int player = 0; player < gamemap->getPlayerCount(); player++ )
425  if ( gamemap->player[player].exist() ) {
426  int result = evaluatevisibilityfield ( gamemap, fld, player, add[player], initial );
427  if ( player_fieldcount_mask & (1 << player ))
428  fieldsChanged += result;
429 
430  }
431 
432  if ( (fld->visible != oldview) && viewState ) {
433  // we are running under action control, the change shall be done by the action and not here,
434  // so we are undoing our change for the moment
435  (*viewState)[MapCoordinate(xx,yy)] = fld->visible;
436  fld->visible = oldview;
437  }
438  }
439 
440 
441  if ( viewState && viewState->size() )
442  (new ChangeView(gamemap,*viewState))->execute(*context);
443 
444  delete viewState;
445  return fieldsChanged;
446 }
447 
448 
449 
450 int computeview( GameMap* gamemap, int player_fieldcount_mask, bool disableShareView, const Context* context )
451 {
452  if ( !gamemap || (gamemap->xsize == 0) || (gamemap->ysize == 0))
453  return 0;
454 
455  clearvisibility( gamemap );
456 
457  for ( int a = 0; a < gamemap->getPlayerCount(); a++)
458  if (gamemap->player[a].exist() ) {
459 
460  for ( Player::VehicleList::iterator i = gamemap->player[a].vehicleList.begin(); i != gamemap->player[a].vehicleList.end(); i++ ) {
461  Vehicle* actvehicle = *i;
462  if ( actvehicle == gamemap->getField(actvehicle->getPosition())->vehicle)
463  actvehicle->addview();
464  }
465 
466  for ( Player::BuildingList::iterator i = gamemap->player[a].buildingList.begin(); i != gamemap->player[a].buildingList.end(); i++ )
467  (*i)->addview();
468  }
469 
470  return evaluateviewcalculation ( gamemap, player_fieldcount_mask, disableShareView, context);
471 }
472 
473 
474 int getPlayersWithSharedViewMask( int player, GameMap* gamemap )
475 {
476  if ( player < 0 )
477  return 0;
478 
479  int add = 0;
480  for ( int i = 0; i < gamemap->getPlayerCount(); i++ )
481  if ( gamemap->player[i].exist() && i != player )
482  if ( gamemap->player[i].diplomacy.sharesView( player) )
483  add |= 1 << i;
484 
485  return add;
486 }
487 
488 #if 0
489 VisibilityStates fieldVisibility( MapField* pe, int player, GameMap* gamemap, int additionalEnemyJamming )
490 {
491  evaluatevisibilityfield( gamemap, pe, player, getPlayersWithSharedViewMask(player,gamemap), gamemap->getgameparameter ( cgp_initialMapVisibility ), additionalEnemyJamming );
492 #ifdef karteneditor
493  player = 0;
494 #endif
495  if ( pe && player >= 0 ) {
496  VisibilityStates c = VisibilityStates((pe->visible >> ( player * 2)) & 3);
497 #ifdef karteneditor
498  c = visible_all;
499 #endif
500 
501  if ( c < gamemap->getInitialMapVisibility( player ) )
502  c = gamemap->getInitialMapVisibility( player );
503 
504  return c;
505  } else
506  return visible_not;
507 }
508 #endif
509 
510 
511 RecalculateAreaView :: RecalculateAreaView( GameMap* gamemap, const MapCoordinate& pos, int range, const Context* context ) : active(false)
512 {
513  position = pos;
514  this->range = range;
515  this->gamemap = gamemap;
516  this->context = context;
517 }
518 
520 {
521  circularFieldIterator( gamemap, position, 0, range, FieldIterationFunctor( this, &RecalculateAreaView::removeFieldView ));
522  active = true;
523 }
524 
526 {
527  circularFieldIterator( gamemap, position, 0, range, FieldIterationFunctor( this, &RecalculateAreaView::addFieldView ));
528  evaluateviewcalculation( gamemap, position, range*maxmalq, 0, false, context );
529  active = false;
530 }
531 
532 void RecalculateAreaView::removeFieldView( const MapCoordinate& pos )
533 {
534  MapField* fld = gamemap->getField(pos);
535  if ( !fld )
536  return;
537 
538  if ( (fld->vehicle || fld->getBuildingEntrance()) && fld->getContainer()->getOwner() < fld->getContainer()->getMap()->getPlayerCount() ) {
539  if ( context )
540  (new ViewRegistration( fld->getContainer(), ViewRegistration::RemoveView ))->execute(*context);
541  else
542  fld->getContainer()->removeview();
543  }
544 }
545 
546 void RecalculateAreaView::addFieldView( const MapCoordinate& pos )
547 {
548  MapField* fld = gamemap->getField(pos);
549  if ( !fld )
550  return;
551 
552 
553  if ( (fld->vehicle || fld->getBuildingEntrance()) && fld->getContainer()->getOwner() < fld->getContainer()->getMap()->getPlayerCount() ) { //excluding neutral buildings here
554  if ( context )
555  (new ViewRegistration( fld->getContainer(), ViewRegistration::AddView ))->execute(*context);
556  else
557  fld->getContainer()->addview();
558  }
559 }
560 
562 {
563  if ( active )
564  addView();
565 }
The (base-) classes which are thrown as exceptions.
void setVisibility(VisibilityStates valtoset, int actplayer)
The visibility status for all players is stored in a bitmapped variable.
Definition: mapfield.cpp:404
VisibilityStates calcvisibilityfield(GameMap *gamemap, MapField *fld, int player, int add, int initial, int additionalEnemyJamming)
calculates the view on a given field.
int xsize
the size of the map
Definition: gamemap.h:201
Definition: ndir.h:39
int computeview(GameMap *gamemap, int player_fieldcount_mask, bool disableShareView, const Context *context)
completely computes the view
const BuildingType * typ
Definition: buildings.h:48
#define chschwimmend
Definition: typen.h:412
Vehicle * vehicle
Definition: mapfield.h:89
map< MapCoordinate, int > ViewState
Definition: changeview.h:32
DiplomaticStateVector diplomacy
Definition: player.h:209
bool hasFunction(ContainerFunctions function) const
int getOwner() const
returns the number of the player this vehicle/building belongs to
Vehicle * getVehicle() const
Definition: mapfield.h:94
struct MapField::View view[8]
VisibilityStates
the different states that a player's view on a field can have
Definition: typen.h:403
A local coordinate referencing a single field that a building covers.
Definition: buildingtype.h:57
MapCoordinate3D getEntry() const
returns the position of the buildings entry
Definition: buildings.cpp:410
void init(const Vehicle *eht, int _mode)
MapCoordinate3D getPosition() const
returns the units position
Definition: vehicle.cpp:1552
bool sharesView(PlayerID receivingPlayer) const
Definition: player.h:81
#define chhochfliegend
Definition: typen.h:416
int mineowner(void)
the player who placed the mines on this field.
Definition: mapfield.cpp:454
void start(int x1, int y1, int x2, int y2)
int evaluatevisibilityfield(GameMap *gamemap, MapField *fld, int player, int add, int initial)
evaluates the view on a given field and saves it for that field.
ContainerBase * getContainer()
returns a pointer to the ContainerBase of the field or NULL if there is none
Definition: mapfield.cpp:331
Global platform dependant definitions. This file just branches to the platform specific files in thei...
a single field of the map
Definition: mapfield.h:26
virtual void removeview(void)=0
removes the containers view (=radar) on the map
int getCompletion() const
returns the completion of the building.
Definition: buildings.h:164
Uint8 satellite
Definition: mapfield.h:231
int height
the current level of height ( BITMAPPED ! )
Definition: vehicle.h:118
int beeline(const Vehicle *a, const Vehicle *b)
returns the distance between the units a and b
virtual void addview(void)=0
registers the containers view (=radar) on the map
bool fieldExists(const LocalCoordinate &localCoordinate) const
returns whether this building covers the given field
Definition: buildingtype.h:108
#define maxmalq
Constants that specify the layout of ASC.
Definition: typen.h:429
VehicleList vehicleList
a list of all units
Definition: player.h:135
Building * getBuildingEntrance()
returns the building if there is one with its entrance on this field
Definition: mapfield.cpp:321
enum Player::PlayerStatus stat
#define chtieffliegend
Definition: typen.h:414
void initsearch(const MapCoordinate &startPosition, int _firstDistance, int _lastDistance)
void setTemp3(int temp3)
Definition: mapfield.cpp:71
Coordinate on the twodimensional map.
Definition: typen.h:202
void circularFieldIterator(GameMap *gamemap, const MapCoordinate &center, int startDist, int stopDist, FieldIterationFunctor functor)
MapField * getField(const BuildingType::LocalCoordinate &localCoordinates) const
returns the pointer to the field which the given part of the building is standing on ...
Definition: buildings.cpp:399
int jamming
the radar jamming power
Uint16 visible
can this field be seen be the player. Variable is bitmapped; two bits for each player. These two bits can have the states defined in VisibilityStates
Definition: mapfield.h:63
draws a straight line on the hexagonal map and calls putpix8 for each field.
Definition: mapalgorithms.h:50
The interface for the buildingtype class.
int evaluateviewcalculation(GameMap *gamemap, int player_fieldcount_mask, bool disableShareView, const Context *context)
evaluates the view on the whole map.
sigc::signal< void > buildingSeen
#define chfahrend
Definition: typen.h:413
Player player[9]
Definition: gamemap.h:253
VisibilityStates fieldVisibility(const MapField *pe)
}@
Definition: spfst.cpp:440
void errorMessage(const ASCString &string)
MapCoordinate startPos
Definition: mapalgorithms.h:31
#define chsatellit
Definition: typen.h:417
int ysize
Definition: gamemap.h:201
int connection
bitmapped: are there events that are triggered by actions affecting this building ...
Definition: buildings.h:60
MineContainer mines
Definition: mapfield.h:117
Uint8 direct
Definition: mapfield.h:231
int getgameparameter(GameParameter num) const
Definition: gamemap.cpp:1047
int height
the levels of height which this unit can enter
BuildingList buildingList
a list of all units
Definition: player.h:139
MapField * field
the array of fields
Definition: gamemap.h:204
int xpos
the position on the map
Definition: vehicle.h:124
int construction_steps
the number of stages that are required to construct a building using a construction unit...
Definition: buildingtype.h:89
const VehicleType * typ
Definition: vehicle.h:83
Building * building
Definition: mapfield.h:102
Vehicle * secondvehicle
two units and the same field are only allowed temporary during movement
Definition: mapfield.h:92
Interface to the event handling of ASC.
GameMap * getMap() const
RecalculateAreaView(GameMap *gamemap, const MapCoordinate &pos, int range, const Context *context)
void clearvisibility(GameMap *gamemap)
An actual building on the map, which references a BuildingType Buildings have an owner,.
Definition: buildings.h:38
virtual void initviewcalculation(int view, int jamming, int sx, int sy, int _mode, int _height)
virtual void testfield(const MapCoordinate &mc)
const int playerNum
the maximum number of players that ASC can manage.
Definition: typen.h:54
int baseJammingMultiplier
int ypos
Definition: vehicle.h:124
void fatalError(const ASCString &string)
int getPlayerCount() const
Definition: gamemap.h:255
int getTemp3()
Definition: mapfield.cpp:74
GameMap * gamemap
Definition: mapalgorithms.h:30
#define chfliegend
Definition: typen.h:415
VisibilityStates getInitialMapVisibility(int player)
Definition: gamemap.cpp:1950
bool exist() const
does the player exist at all
Definition: player.cpp:313
Loki::Functor< void, LOKI_TYPELIST_1(const MapCoordinate &) > FieldIterationFunctor
Definition: mapalgorithms.h:43
#define minmalq
Definition: typen.h:430
void addview()
adds the units view to the map.
Definition: vehicle.cpp:990
#define direct
int getPlayersWithSharedViewMask(int player, GameMap *gamemap)
The map. THE central structure of ASC, which holds everything not globally available together...
Definition: gamemap.h:182
MapField * getField(int x, int y)
Definition: gamemap.h:465
void init(const Building *bld, int _mode)