WormAIDev  Worm SELF_VERSION
 All Classes Files Functions Variables Pages
Static Public Member Functions | List of all members
WormTiles Class Reference

Define the WormTiles class containing tile related functions. More...

Static Public Member Functions

static function SafeAddSquare (list, tile, radius)
 Add a square area to an AITileList containing tiles that are within radius tiles from the center tile, taking the edges of the map into account.
static function SafeAddRectangle (tile_list, center_tile, x_min, y_min, x_plus, y_plus)
 A safe implementation of AITileList.AddRectangle.
static function GetDirection (tilefrom, tileto)
 Get the direction from one tile to another.

Detailed Description

Define the WormTiles class containing tile related functions.

Member Function Documentation

function WormTiles::GetDirection ( tilefrom  ,
tileto   
)
static

Get the direction from one tile to another.

Note
Taken from SimpleAI.
Parameters
tilefromThe first tile.
tiletoThe second tile
Returns
The direction from the first tile to the second tile.
function WormTiles::SafeAddRectangle ( tile_list  ,
center_tile  ,
x_min  ,
y_min  ,
x_plus  ,
y_plus   
)
static

A safe implementation of AITileList.AddRectangle.

Only valid tiles are added to the tile list.

Note
Taken from AdmiralAI.
Parameters
tile_listThe AITileList to add the tiles to.
center_tileThe center of the rectangle.
x_minThe amount of tiles to the north-east, relative to center_tile.
y_minThe amount of tiles to the north-west, relative to center_tile.
x_plusThe amount of tiles to the south-west, relative to center_tile.
y_plusThe amount of tiles to the south-east, relative to center_tile.
function WormTiles::SafeAddSquare ( list  ,
tile  ,
radius   
)
static

Add a square area to an AITileList containing tiles that are within radius tiles from the center tile, taking the edges of the map into account.

Note
This function was taken from Rondje. Name was changed from SafeAddRectangle to SafeAddSquare.
Parameters
listThe AITileList in which the valid tiles will be returned.
tileThe center tile.
radiusThe radius of tiles.

The documentation for this class was generated from the following file: