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.
|
static function | GetNextDirection (direction, clockwise) |
| Get the next direction clockwise or counterclockwise relative to the specified direction.
|
static function | DirectionToRailTrackDirection (direction) |
| Convert our tile direction to AIRail RailTrack direction.
|
Static Public Attributes |
static | DIR_NE = 2 |
static | DIR_NW = 0 |
static | DIR_SE = 1 |
static | DIR_SW = 3 |
Detailed Description
Define the WormTiles class containing tile related functions.
Member Function Documentation
function WormTiles::DirectionToRailTrackDirection |
( |
direction |
| ) |
|
|
static |
Convert our tile direction to AIRail RailTrack direction.
- Parameters
-
direction | The tile direction. |
- Returns
- The RailTrack direction.
function WormTiles::GetDirection |
( |
tilefrom |
, |
|
|
tileto |
|
|
) |
| |
|
static |
Get the direction from one tile to another.
- Note
- Taken from SimpleAI.
- Parameters
-
tilefrom | The first tile. |
tileto | The second tile |
- Returns
- The direction from the first tile to the second tile.
function WormTiles::GetNextDirection |
( |
direction |
, |
|
|
clockwise |
|
|
) |
| |
|
static |
Get the next direction clockwise or counterclockwise relative to the specified direction.
- Parameters
-
direction | The current direction |
clockwise | Boolean: true go clockwise, false go counter clockwise. |
- Returns
- The next direction.
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_list | The AITileList to add the tiles to. |
center_tile | The center of the rectangle. |
x_min | The amount of tiles to the north-east, relative to center_tile. |
y_min | The amount of tiles to the north-west, relative to center_tile. |
x_plus | The amount of tiles to the south-west, relative to center_tile. |
y_plus | The 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
-
list | The AITileList in which the valid tiles will be returned. |
tile | The center tile. |
radius | The radius of tiles. |
The documentation for this class was generated from the following file: