OpenTTD Source 20251005-master-ga617d009cc
|
Implementation of YAPF for water regions, which are used for finding intermediate ship destinations. More...
#include "../../stdafx.h"
#include "../../ship.h"
#include "yapf.hpp"
#include "yapf_ship_regions.h"
#include "../water_regions.h"
#include "../../safeguards.h"
Go to the source code of this file.
Data Structures | |
struct | WaterRegionPatchKey |
Yapf Node Key that represents a single patch of interconnected water within a water region. More... | |
struct | WaterRegionNode |
Yapf Node for water regions. More... | |
struct | WaterRegionFollower |
struct | WaterRegionTypes |
class | YapfShipRegions |
Water region based YAPF implementation for ships. More... | |
Typedefs | |
using | WaterRegionNodeList = NodeList< WaterRegionNode, NODE_LIST_HASH_BITS_OPEN, NODE_LIST_HASH_BITS_CLOSED > |
Functions | |
uint | ManhattanDistance (const WaterRegionPatchKey &a, const WaterRegionPatchKey &b) |
std::vector< WaterRegionPatchDesc > | YapfShipFindWaterRegionPath (const Ship *v, TileIndex start_tile, int max_returned_path_length) |
Finds a path at the water region level. | |
Variables | |
static constexpr int | DIRECT_NEIGHBOUR_COST = 100 |
static constexpr int | NODES_PER_REGION = 4 |
static constexpr int | MAX_NUMBER_OF_NODES = 65536 |
static constexpr int | NODE_LIST_HASH_BITS_OPEN = 12 |
static constexpr int | NODE_LIST_HASH_BITS_CLOSED = 12 |
Implementation of YAPF for water regions, which are used for finding intermediate ship destinations.
Definition in file yapf_ship_regions.cpp.
using WaterRegionNodeList = NodeList<WaterRegionNode, NODE_LIST_HASH_BITS_OPEN, NODE_LIST_HASH_BITS_CLOSED> |
Definition at line 76 of file yapf_ship_regions.cpp.
|
inline |
Definition at line 39 of file yapf_ship_regions.cpp.
std::vector< WaterRegionPatchDesc > YapfShipFindWaterRegionPath | ( | const Ship * | v, |
TileIndex | start_tile, | ||
int | max_returned_path_length | ||
) |
Finds a path at the water region level.
Note that the starting region is always included if the path was found.
v | The ship to find a path for. |
start_tile | The tile to start searching from. |
max_returned_path_length | The maximum length of the path that will be returned. |
Definition at line 228 of file yapf_ship_regions.cpp.
|
staticconstexpr |
Definition at line 19 of file yapf_ship_regions.cpp.
|
staticconstexpr |
Definition at line 21 of file yapf_ship_regions.cpp.
|
staticconstexpr |
Definition at line 24 of file yapf_ship_regions.cpp.
|
staticconstexpr |
Definition at line 23 of file yapf_ship_regions.cpp.
|
staticconstexpr |
Definition at line 20 of file yapf_ship_regions.cpp.