Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
CCmpTerritoryManager.cpp File Reference
Include dependency graph for CCmpTerritoryManager.cpp:

Classes

class  TerritoryOverlay
 
class  CCmpTerritoryManager
 
struct  CCmpTerritoryManager::SBoundaryLine
 
struct  Tile
 

Functions

template<typename Decider >
void Floodfill (const Tile &origin, const Tile &gridSize, Decider decider)
 Queue based eight directional floodfill algorithm. More...
 
static void NearestTerritoryTile (entity_pos_t x, entity_pos_t z, u16 &i, u16 &j, u16 w, u16 h)
 Compute the tile indexes on the grid nearest to a given point. More...
 

Function Documentation

◆ Floodfill()

template<typename Decider >
void Floodfill ( const Tile origin,
const Tile gridSize,
Decider  decider 
)

Queue based eight directional floodfill algorithm.

Parameters
originWhere to start the floodfill. In the first iteration it is passed as the second argument to the
See also
decider and the floodfill only continues when the invocation returns true.
Parameters
gridSizeTiles outside the boundary are never exteded. The
See also
decider isn't called with thous tiles.
Parameters
deciderIt is called with a tile wich was already added as the first argument and a neighbour as the second argument. The invocation shall return whether to extend the wavefront to the neighbour (if allways true is returned, an infinite loop will occur). In the first iteration the
See also
decider is invoked with a null pointer as the first argument and
origin as the second argument.

◆ NearestTerritoryTile()

static void NearestTerritoryTile ( entity_pos_t  x,
entity_pos_t  z,
u16 i,
u16 j,
u16  w,
u16  h 
)
static

Compute the tile indexes on the grid nearest to a given point.