Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
PathCost Struct Reference

Represents the cost of a path consisting of horizontal/vertical and diagonal movements over a uniform-cost grid. More...

#include <Pathfinding.h>

Public Member Functions

 PathCost ()
 
 PathCost (std::uint16_t hv, std::uint16_t d)
 Construct from a number of horizontal/vertical and diagonal steps. More...
 
PathCost operator+ (const PathCost &a) const
 
PathCost & operator+= (const PathCost &a)
 
bool operator<= (const PathCost &b) const
 
bool operator< (const PathCost &b) const
 
bool operator>= (const PathCost &b) const
 
bool operator> (const PathCost &b) const
 
std::uint32_t ToInt ()
 

Static Public Member Functions

static PathCost horizvert (std::uint16_t n)
 Construct for horizontal/vertical movement of given number of steps. More...
 
static PathCost diag (std::uint16_t n)
 Construct for diagonal movement of given number of steps. More...
 

Private Attributes

std::uint32_t data
 

Detailed Description

Represents the cost of a path consisting of horizontal/vertical and diagonal movements over a uniform-cost grid.

Maximum path length before overflow is about 45K steps.

Constructor & Destructor Documentation

◆ PathCost() [1/2]

PathCost::PathCost ( )
inline

◆ PathCost() [2/2]

PathCost::PathCost ( std::uint16_t  hv,
std::uint16_t  d 
)
inline

Construct from a number of horizontal/vertical and diagonal steps.

Member Function Documentation

◆ diag()

static PathCost PathCost::diag ( std::uint16_t  n)
inlinestatic

Construct for diagonal movement of given number of steps.

◆ horizvert()

static PathCost PathCost::horizvert ( std::uint16_t  n)
inlinestatic

Construct for horizontal/vertical movement of given number of steps.

◆ operator+()

PathCost PathCost::operator+ ( const PathCost &  a) const
inline

◆ operator+=()

PathCost & PathCost::operator+= ( const PathCost &  a)
inline

◆ operator<()

bool PathCost::operator< ( const PathCost &  b) const
inline

◆ operator<=()

bool PathCost::operator<= ( const PathCost &  b) const
inline

◆ operator>()

bool PathCost::operator> ( const PathCost &  b) const
inline

◆ operator>=()

bool PathCost::operator>= ( const PathCost &  b) const
inline

◆ ToInt()

std::uint32_t PathCost::ToInt ( )
inline

Member Data Documentation

◆ data

std::uint32_t PathCost::data
private

The documentation for this struct was generated from the following file: