MinchinWeb's MetaLibrary
v.9
Library functions of OpenTTD AI 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? More... | |
function | PresetSafety (Start, End) |
Caps the pathfinder as twice the Manhattan distance between the two tiles. More... | |
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. More... | |
_distance_penalty = null | |
Penalty to use to speed up pathfinder, 1 is no penalty. More... | |
_pathfinder = null | |
cost = null | |
Used to change the costs. More... | |
_running = null | |
Is it running? More... | |
_mypath = 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. |
false
if the amount of iterations was reached, or null
if no path was found. false
, which is an indication it is not yet done looking for a route. 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 248 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.