MinchinWeb's MetaLibrary
v.9
Library functions of OpenTTD AI writers.
|
Spiral Walker. More...
Public Member Functions | |
function | Start (Tile) |
Sets the starting tile for SpiralWalker. More... | |
function | Reset () |
Resets the variables for the SpiralWalker. More... | |
function | Restart () |
Moves the SpiralWalker to the original starting position. More... | |
function | Walk () |
'Walks' the SpiralWalker one tile at a tile More... | |
function | GetStart () |
Returns the tile the SpiralWalker is starting on. More... | |
function | GetStage () |
Returns the Stage the SpiralWalker is on. More... | |
function | GetTile () |
Returns the Tile the SpiralWalker is on. More... | |
function | GetStep () |
Returns the number of steps the SpiralWalker has done. More... | |
Private Member Functions | |
constructor () | |
Private Attributes | |
_start = null | |
start tile More... | |
_startx = null | |
x value of start tile More... | |
_starty = null | |
y value of start tile More... | |
_x = null | |
x value of current tile More... | |
_y = null | |
y value of current tile More... | |
_current_tile = null | |
current tile More... | |
_dx = null | |
_dy = null | |
_Steps = null | |
see GetStep() More... | |
_Stage = null | |
see GetStage() More... | |
_StageMax = null | |
_StageSteps = null | |
Spiral Walker.
The SpiralWalker class allows you to define a starting point, and then 'walk' all the tiles in a spiral outward. It was originally used to find a build-able spot for my HQ in WmDOT, but is useful for many other things as well.
SpiralWalker
is designed to be a persistent class. Definition at line 44 of file Spiral.Walker.nut.
|
inlineprivate |
Definition at line 58 of file Spiral.Walker.nut.
|
inline |
Returns the Stage the SpiralWalker is on.
Basically, the line segments its completed plus one; it takes four stages to complete a revolution.
Definition at line 104 of file Spiral.Walker.nut.
|
inline |
Returns the tile the SpiralWalker is starting on.
Definition at line 94 of file Spiral.Walker.nut.
|
inline |
Returns the number of steps the SpiralWalker has done.
Definition at line 118 of file Spiral.Walker.nut.
|
inline |
Returns the Tile the SpiralWalker is on.
Definition at line 111 of file Spiral.Walker.nut.
function _MinchinWeb_SW_::Reset | ( | ) |
Resets the variables for the SpiralWalker.
Definition at line 140 of file Spiral.Walker.nut.
function _MinchinWeb_SW_::Restart | ( | ) |
Moves the SpiralWalker to the original starting position.
Definition at line 149 of file Spiral.Walker.nut.
function _MinchinWeb_SW_::Start | ( | Tile | ) |
Sets the starting tile for SpiralWalker.
Definition at line 123 of file Spiral.Walker.nut.
function _MinchinWeb_SW_::Walk | ( | ) |
'Walks' the SpiralWalker one tile at a tile
Definition at line 162 of file Spiral.Walker.nut.
|
private |
current tile
Definition at line 50 of file Spiral.Walker.nut.
|
private |
Definition at line 51 of file Spiral.Walker.nut.
|
private |
Definition at line 52 of file Spiral.Walker.nut.
|
private |
see GetStage()
Definition at line 54 of file Spiral.Walker.nut.
|
private |
Definition at line 55 of file Spiral.Walker.nut.
|
private |
Definition at line 56 of file Spiral.Walker.nut.
|
private |
start tile
Definition at line 45 of file Spiral.Walker.nut.
|
private |
x value of start tile
Definition at line 46 of file Spiral.Walker.nut.
|
private |
y value of start tile
Definition at line 47 of file Spiral.Walker.nut.
|
private |
see GetStep()
Definition at line 53 of file Spiral.Walker.nut.
|
private |
x value of current tile
Definition at line 48 of file Spiral.Walker.nut.
|
private |
y value of current tile
Definition at line 49 of file Spiral.Walker.nut.