Class Index | File Index

Classes


Class Map


Defined in: map.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Map()
Class Map
Method Summary
Method Attributes Method Name and Description
 
Allocate a default cell to one player
 
getCell(x, y)
Get a cell by coodinates x and y
 
Calculate the Manathan distance between two cells
 
this method changes the coordinates of the diamond cell to transform it to a square cells
 
Transform the map's attributs to a JSON string
Class Detail
Map()
Class Map
Method Detail
allocStartPoint()
Allocate a default cell to one player
Returns:
this.startPoints.shift(): a first cells at the startPoints array.

getCell(x, y)
Get a cell by coodinates x and y
Parameters:
x
Coordinate x of this cell
y
Coordinate y of this cell
Returns:
cell

getDistanceBetween()
Calculate the Manathan distance between two cells
Parameters:
c1.
the first cell,
c2.
the seconde cell,
Returns:
distance. the distance between c1 and c2.

getStartPoints(cell,)
this method changes the coordinates of the diamond cell to transform it to a square cells
Parameters:
cell,
the diamond cell
Returns:
c, the transformed cell

toJSON()
Transform the map's attributs to a JSON string
Returns:
the JSON string.

Documentation generated by JsDoc Toolkit 2.4.0 on Tue Apr 05 2011 21:22:01 GMT+0200 (CEST)