ManaPlus
location.h
Go to the documentation of this file.
1 /*
2  * The ManaPlus Client
3  * Copyright (C) 2004-2009 The Mana World Development Team
4  * Copyright (C) 2009-2010 The Mana Developers
5  * Copyright (C) 2011-2019 The ManaPlus Developers
6  *
7  * This file is part of The ManaPlus Client.
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program. If not, see <http://www.gnu.org/licenses/>.
21  */
22 
23 #ifndef RESOURCES_MAP_LOCATION_H
24 #define RESOURCES_MAP_LOCATION_H
25 
26 #include "resources/map/metatile.h"
27 
28 #include "localconsts.h"
29 
34 {
38  Location(const int px,
39  const int py,
40  MetaTile *const ptile) :
41  x(px),
42  y(py),
43  tileCost(ptile->Fcost),
44  tile(ptile)
45  {}
46 
48 
49 
52  bool operator< (const Location &loc) const
53  {
54  return tileCost > loc.tileCost;
55  }
56 
57  int x, y;
58  int tileCost;
60 };
61 
62 #endif // RESOURCES_MAP_LOCATION_H
metatile.h
Location
Definition: location.h:33
Location::tileCost
int tileCost
Definition: location.h:58
localconsts.h
A_DEFAULT_COPY
#define A_DEFAULT_COPY(func)
Definition: localconsts.h:40
bool
Location::y
int y
Definition: location.h:57
final
#define final
Definition: localconsts.h:45
MetaTile
Definition: metatile.h:33
Location::Location
Location(const int px, const int py, MetaTile *const ptile)
Definition: location.h:38
Location::x
int x
Definition: location.h:57
Location::tile
MetaTile * tile
Definition: location.h:59