Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

mapalgorithms.h File Reference

#include "typen.h"
#include "vehicle.h"
#include "libs/loki/Functor.h"

Include dependency graph for mapalgorithms.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef Loki::Functor< void,
TYPELIST_1(const MapCoordinate &) 
FieldIterationFunctor )

Functions

void circularFieldIterator (GameMap *gamemap, const MapCoordinate &center, int startDist, int stopDist, FieldIterationFunctor functor)
void getnextfield (int &x, int &y, int direc)
 changes x and y to the coordinates of the neighbouring field of (x/y) in the direction direc
MapCoordinate3D getNeighbouringFieldCoordinate (const MapCoordinate3D &pos, int direc)
 returns the coordinate of the field that is adjecent to the given field in the direction of direc
MapCoordinate getNeighbouringFieldCoordinate (const MapCoordinate &pos, int direc)
int getdirection (int x1, int y1, int x2, int y2)
 gets the direction from x1/y1 to x2/y2
int getdirection (const MapCoordinate &start, const MapCoordinate &dest)
int beeline (int x1, int y1, int x2, int y2)
 returns the distance between (x1/y1) and (x2/y2)
int beeline (const Vehicle *a, const Vehicle *b)
 returns the distance between the units a and b
int beeline (const MapCoordinate &a, const MapCoordinate &b)
 returns the distance between map positions a and b


Typedef Documentation

typedef Loki::Functor<void, TYPELIST_1(const MapCoordinate&) FieldIterationFunctor)
 

Definition at line 42 of file mapalgorithms.h.


Function Documentation

int beeline const MapCoordinate a,
const MapCoordinate b
 

returns the distance between map positions a and b

Definition at line 388 of file mapalgorithms.cpp.

References beeline(), MapCoordinate::x, and MapCoordinate::y.

int beeline const Vehicle a,
const Vehicle b
 

returns the distance between the units a and b

Definition at line 383 of file mapalgorithms.cpp.

References beeline(), Vehicle::xpos, and Vehicle::ypos.

int beeline int  x1,
int  y1,
int  x2,
int  y2
 

returns the distance between (x1/y1) and (x2/y2)

Definition at line 394 of file mapalgorithms.cpp.

References max(), and minmalq.

void circularFieldIterator GameMap gamemap,
const MapCoordinate center,
int  startDist,
int  stopDist,
FieldIterationFunctor  functor
 

Definition at line 282 of file mapalgorithms.cpp.

References SearchFields::initsearch(), and SearchFields::startsearch().

Referenced by RecalculateAreaView::addView(), placeCurrentItem(), RecalculateAreaView::removeView(), AutoHarvestObjects::run(), and ServiceTargetSearcher::startSearch().

int getdirection const MapCoordinate start,
const MapCoordinate dest
 

Definition at line 346 of file mapalgorithms.cpp.

References getdirection(), MapCoordinate::x, and MapCoordinate::y.

int getdirection int  x1,
int  y1,
int  x2,
int  y2
 

gets the direction from x1/y1 to x2/y2

Returns:
-1 if the fields are identical

Definition at line 351 of file mapalgorithms.cpp.

MapCoordinate getNeighbouringFieldCoordinate const MapCoordinate pos,
int  direc
 

Definition at line 300 of file mapalgorithms.cpp.

References getnextfield(), MapCoordinate::x, and MapCoordinate::y.

MapCoordinate3D getNeighbouringFieldCoordinate const MapCoordinate3D pos,
int  direc
 

returns the coordinate of the field that is adjecent to the given field in the direction of direc

Definition at line 293 of file mapalgorithms.cpp.

References getnextfield(), MapCoordinate::x, and MapCoordinate::y.

void getnextfield int &  x,
int &  y,
int  direc
 

changes x and y to the coordinates of the neighbouring field of (x/y) in the direction direc

Definition at line 308 of file mapalgorithms.cpp.

Referenced by calcMoveMalus(), ForestCalculation::calculateforest(), calculateobject(), ResourceNet::fieldavail(), AStar::findPath(), AStar3D::findPath(), getNeighbouringFieldCoordinate(), ForestCalculation::Smoothing::GetNeighbourMask(), MapNetwork::searchbuilding(), MapNetwork::searchfield(), tdrawgettempline::start(), SearchFields::startsearch(), and windbeeline().


Generated on Tue Jun 24 01:50:12 2008 for Advanced Strategic Command by  doxygen 1.4.2