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 34 of file location.h.

Constructor & Destructor Documentation

◆ Location()

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

Constructor.

Definition at line 39 of file location.h.

41  :
42  x(px),
43  y(py),
44  tileCost(ptile->Fcost),
45  tile(ptile)
46  {}
int y
Definition: location.h:58
int tileCost
Definition: location.h:59
MetaTile * tile
Definition: location.h:60
int x
Definition: location.h:58
int Fcost
Definition: metatile.h:46

Member Function Documentation

◆ operator<()

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

Comparison operator.

Definition at line 53 of file location.h.

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

References tileCost.

Field Documentation

◆ tile

MetaTile* Location::tile

Definition at line 60 of file location.h.

Referenced by Map::findPath().

◆ tileCost

int Location::tileCost

Definition at line 59 of file location.h.

Referenced by operator<().

◆ x

int Location::x

Definition at line 58 of file location.h.

Referenced by Map::findPath().

◆ y

int Location::y

Definition at line 58 of file location.h.

Referenced by Map::findPath().


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