Pyrogenesis trunk
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
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 (u16 hv, u16 d)
 Construct from a number of horizontal/vertical and diagonal steps. More...
 
PathCost operator+ (const PathCost &a) const
 
PathCostoperator+= (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
 
u32 ToInt ()
 

Static Public Member Functions

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

Private Attributes

u32 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 ( u16  hv,
u16  d 
)
inline

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

Member Function Documentation

◆ diag()

static PathCost PathCost::diag ( u16  n)
inlinestatic

Construct for diagonal movement of given number of steps.

◆ horizvert()

static PathCost PathCost::horizvert ( u16  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()

u32 PathCost::ToInt ( )
inline

Member Data Documentation

◆ data

u32 PathCost::data
private

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