Class Index | File Index

Classes


Class Player


Defined in: player.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Player()
Class Player
Method Summary
Method Attributes Method Name and Description
 
Create a new unit for player : assign a movement value to the unit and notify it.
 
checks if the player has a unit
 
Notify any change in the context
 
Assign the maximun movement value to the player units.
 
Transform the player's attributs to a JSON string
Class Detail
Player()
Class Player
Method Detail
addUnit()
Create a new unit for player : assign a movement value to the unit and notify it.
Parameters:
type.
the type of unit
Returns:
unit. the player unit

hasUnit()
checks if the player has a unit
Parameters:
unitId.
the unit identity
Returns:
boolean. returns true if the player has this unit, and returns false otherwise.

onUpdate()
Notify any change in the context
Parameters:
context.
The player context.

resetUnits()
Assign the maximun movement value to the player units.

toJSON()
Transform the player'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)