|
MinchinWeb's MetaLibrary v.11
Library functions for OpenTTD AI (and GS) writers.
|
Waterbody Check (deprecated) More...
Classes | |
| class | Cost |
Public Member Functions | |
| function | InitializePath (sources, goals) |
| function | FindPath (iterations) |
| function | GetPathLength () |
| How long is the (found) path? | |
| function | PresetSafety (Start, End) |
| Caps the pathfinder as twice the Manhattan distance between the two tiles. | |
Private Member Functions | |
| constructor () | |
| function | _Cost (self, path, new_tile, new_direction) |
| function | _Estimate (self, cur_tile, cur_direction, goal_tiles) |
| function | _Neighbours (self, path, cur_node) |
| function | _CheckDirection (self, tile, existing_direction, new_direction) |
| function | _GetDirection (from, to) |
Private Attributes | |
| _aystar_class = import("graph.aystar", "", 6) | |
| _cost_per_tile = null | |
| _max_cost = null | |
| The maximum cost for a route. | |
| _distance_penalty = null | |
| Penalty to use to speed up pathfinder, 1 is no penalty. | |
| _pathfinder = null | |
| cost = null | |
| Used to change the costs. | |
| _running = null | |
| Is it running? | |
| _my_path = null | |
Waterbody Check (deprecated)
Waterbody check is in effect a specialized pathfinder. It serves to check whether two points are in the same waterbody (i.e. a ship could travel between them). It is optimized to run extremely fast (I hope!). It can be called separately, but was originally designed as a pre-run check for my Ship Pathfinder (also included in this MetaLibrary).
It is based on the NoAI Team's Road Pathfinder v3.
Definition at line 60 of file Waterbody.Check.nut.
|
private |
Definition at line 221 of file Waterbody.Check.nut.
|
private |
Definition at line 173 of file Waterbody.Check.nut.
|
private |
Definition at line 190 of file Waterbody.Check.nut.
|
private |
Definition at line 225 of file Waterbody.Check.nut.
|
private |
Definition at line 200 of file Waterbody.Check.nut.
|
inlineprivate |
Definition at line 70 of file Waterbody.Check.nut.
| function _MinchinWeb_WBC_::FindPath | ( | iterations | ) |
Try to find the path as indicated with InitializePath with the lowest cost.
| iterations | After how many iterations it should abort for a moment. This value should either be -1 for infinite, or > 0. Any other value aborts immediately and will never find a path. |
Definition at line 165 of file Waterbody.Check.nut.
| function _MinchinWeb_WBC_::GetPathLength | ( | ) |
How long is the (found) path?
Definition at line 233 of file Waterbody.Check.nut.
|
inline |
Initialize a path search between sources and goals.
| sources | The source tiles. |
| goals | The target tiles. |
Definition at line 86 of file Waterbody.Check.nut.
| function _MinchinWeb_WBC_::PresetSafety | ( | Start | , |
| End | ) |
Caps the pathfinder as twice the Manhattan distance between the two tiles.
Definition at line 247 of file Waterbody.Check.nut.
|
private |
Definition at line 61 of file Waterbody.Check.nut.
|
private |
Definition at line 62 of file Waterbody.Check.nut.
|
private |
Penalty to use to speed up pathfinder, 1 is no penalty.
Definition at line 64 of file Waterbody.Check.nut.
|
private |
The maximum cost for a route.
Definition at line 63 of file Waterbody.Check.nut.
|
private |
Definition at line 68 of file Waterbody.Check.nut.
|
private |
Definition at line 65 of file Waterbody.Check.nut.
|
private |
Is it running?
Definition at line 67 of file Waterbody.Check.nut.
|
private |
Used to change the costs.
Definition at line 66 of file Waterbody.Check.nut.