be. dauntless. Astar.Tile

be.dauntless.Astar.Tile
Summary
Constructor.
Set the ability to walk on this the tile
Set this tile to be in the open-array.
Set this tile to be in the closed-array.
returns whether or not the tile is in the closed list.
returns whether or not the tile is in the open list.
sets the parent of the node
Returns the parent of the node
sets the H for the node.
Sets the G (cost) for the tile
Returns the F of the tile (F = G + H);
Returns the H of the tile
Set the cost for the tile
get the G (cost) of the tile
Returns the cost for the tile
Toggles the ability to walk on the tile
This method resets the tile for further use
This method tells the node that its being accessed diagonally
This method tells the node that its NOT being accessed diagonally
This method is called by A*.

Variables

count

public static var count: Number

inOpen

private var inOpen: Boolean

closed

private var closed: Boolean

parent

private var parent: Tile

ids

private static var ids: Number

gUp

private var gUp: Boolean

h

private var h: Number

g

private var g: Number

cost

private var cost: Number

x

public var x: Number

y

public var y: Number

id

public var id: Number

walkable

public var walkable: Boolean

Functions

Tile

public function Tile(xp: Number,
yp: Number)

Constructor.  Set the x, y and cost of the tile;

Parameters

xx position of the tile;
yy position of the tile;
costcost of the tile;

Returns

Nothing

setWalkable

public function setWalkable(b: Boolean):Void

Set the ability to walk on this the tile

Parameters

walkableBoolean value whether or not the tile is walkable

Returns

Nothing

setOpen

public function setOpen():Void

Set this tile to be in the open-array.  This is used by the findPath method of the Astar class.

Parameters

None

Returns

Nothing

See also

setClosed

setWalkable

setClosed

public function setClosed():Void

Set this tile to be in the closed-array.  This is used by the findPath method of the Astar class.

Parameters

None

Returns

Nothing

See also

setOpen

setWalkable

isClosed

public function isClosed():Boolean

returns whether or not the tile is in the closed list.

Parameters

None

Returns

closedBoolean representing whether or not its closed

getOpen

public function getOpen():Boolean

returns whether or not the tile is in the open list.

Parameters

None

Returns

openBoolean representing whether or not its open

setParent

public function setParent(t: Tile):Void

sets the parent of the node

Parameters

TileParent of the node

Returns

Nothing

getParent

public function getParent():Tile

Returns the parent of the node

Parameters

None

Returns

The parent of the node

setH

public function setH(ex: Number,
ey: Number):Void

sets the H for the node.  H is calculated with the manhatten method.

Parameters

exnumber representing the x position of the endPoint
eynumber representing the y position of the endPoint

Returns

Nothing

setG

public function setG(_g: Number):Void

Sets the G (cost) for the tile

Parameters

gthe cost of the parent tile

Returns

Nothing

getF

public function getF():Number

Returns the F of the tile (F = G + H);

Parameters

None

Returns

FThe F of the tile

getH

public function getH():Number

Returns the H of the tile

Parameters

None

Returns

HThe H of the tile

setCost

public function setCost(_cost: Number):Void

Set the cost for the tile

Parameters

costcost of the tile

Returns

Nothing

getG

public function getG():Number

get the G (cost) of the tile

Parameters

None

Returns

gthe total cost of the tile

getCost

public function getCost():Number

Returns the cost for the tile

Parameters

None

Returns

costthe cost of the tile

toggleWalkable

public function toggleWalkable():Void

Toggles the ability to walk on the tile

Parameters

None

Returns

Nothing

reset

public function reset():Void

This method resets the tile for further use

Parameters

None

Returns

Nothing

costUp

public function costUp():Void

This method tells the node that its being accessed diagonally

Parameters

None

Returns

Nothing

costDown

public function costDown():Void

This method tells the node that its NOT being accessed diagonally

Parameters

None

Returns

Nothing

notice

public function notice():Void

This method is called by A*.  It tells the tile that it’s in the found path.  This can be used when you extend the tile class.

Parameters

None

Returns

Nothing

public static var count: Number
private var inOpen: Boolean
private var closed: Boolean
private var parent: Tile
private static var ids: Number
private var gUp: Boolean
private var h: Number
private var g: Number
private var cost: Number
public var x: Number
public var y: Number
public var id: Number
public var walkable: Boolean
public function Tile(xp: Number,
yp: Number)
Constructor.
public function setWalkable(b: Boolean):Void
Set the ability to walk on this the tile
public function setOpen():Void
Set this tile to be in the open-array.
public function setClosed():Void
Set this tile to be in the closed-array.
public function isClosed():Boolean
returns whether or not the tile is in the closed list.
public function getOpen():Boolean
returns whether or not the tile is in the open list.
public function setParent(t: Tile):Void
sets the parent of the node
public function getParent():Tile
Returns the parent of the node
public function setH(ex: Number,
ey: Number):Void
sets the H for the node.
public function setG(_g: Number):Void
Sets the G (cost) for the tile
public function getF():Number
Returns the F of the tile (F = G + H);
public function getH():Number
Returns the H of the tile
public function setCost(_cost: Number):Void
Set the cost for the tile
public function getG():Number
get the G (cost) of the tile
public function getCost():Number
Returns the cost for the tile
public function toggleWalkable():Void
Toggles the ability to walk on the tile
public function reset():Void
This method resets the tile for further use
public function costUp():Void
This method tells the node that its being accessed diagonally
public function costDown():Void
This method tells the node that its NOT being accessed diagonally
public function notice():Void
This method is called by A*.