ManaPlus
Public Member Functions | Data Fields
Location Struct Reference

#include <location.h>

Public Member Functions

 Location (const int px, const int py, MetaTile *const ptile)
 
bool operator< (const Location &loc) const
 

Data Fields

int x
 
int y
 
int tileCost
 
MetaTiletile
 

Detailed Description

A location on a tile map. Used for pathfinding, open list.

Definition at line 33 of file location.h.

Constructor & Destructor Documentation

◆ Location()

Location::Location ( const int  px,
const int  py,
MetaTile *const  ptile 
)
inline

Constructor.

Definition at line 38 of file location.h.

40  :
41  x(px),
42  y(py),
43  tileCost(ptile->Fcost),
44  tile(ptile)
45  {}

Member Function Documentation

◆ operator<()

bool Location::operator< ( const Location loc) const
inline

Comparison operator.

Definition at line 52 of file location.h.

53  {
54  return tileCost > loc.tileCost;
55  }

References tileCost.

Field Documentation

◆ tile

MetaTile* Location::tile

Definition at line 59 of file location.h.

Referenced by Map::findPath().

◆ tileCost

int Location::tileCost

Definition at line 58 of file location.h.

Referenced by operator<().

◆ x

int Location::x

Definition at line 57 of file location.h.

Referenced by Map::findPath().

◆ y

int Location::y

Definition at line 57 of file location.h.

Referenced by Map::findPath().


The documentation for this struct was generated from the following file:
Location::tileCost
int tileCost
Definition: location.h:58
Location::y
int y
Definition: location.h:57
Location::x
int x
Definition: location.h:57
MetaTile::Fcost
int Fcost
Definition: metatile.h:45
Location::tile
MetaTile * tile
Definition: location.h:59