|
nanoMMO 0.97.8
Building an MMO: The Engineering Series
|
#include <paths.h>
Public Member Functions | |
| Paths (const Terrain &terrain) | |
| std::vector< Place > | Find (Place from, Place to) |
| bool | Clear (Place from, Place to) const |
| bool | Open (Place place) const |
| Whether the square the place is in is one a player can walk on. | |
| int | searched () const |
| How many squares the last search looked at. | |
Static Public Attributes | |
| static constexpr float | kSquare = 1.0f |
| In metres along each side. | |
| static constexpr int | kMostSearched = 40000 |
| A little under a sixth of the island's squares. | |
The ways across a land: which of its metre squares a player can walk on, and the shortest way from one place to another over them, which A* finds. A world finds a way each time a player asks to walk somewhere, between ticks, so a search looks at kMostSearched squares at most, and then goes as near as it got.
| bool nanommo::Paths::Open | ( | Place | place | ) | const |
|
inline |
|
staticconstexpr |
|
staticconstexpr |