Class Index | File Index

Classes


Class Unit


Defined in: unit.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Unit()
Class Unit
Method Summary
Method Attributes Method Name and Description
 
Adds a new properties to unit.
 
checks whether a property is present in the list of properties
 
Moves the unit to another cell,
 
Removes one property from a properties list.
 
Assign the maximun movement value to the unit.
 
The defense attack: assign a attack value to the unit and notify it.
 
The cell setter: assign a cell to the unit and notify it.
 
The defense setter: assign a defense value to the unit and notify it.
 
The health setter: assign a health value to the unit and notify it.
 
The movement setter: assign a movement value to the unit and notify it.
 
The range setter: assign a range value to the unit and notify it.
 
The view setter: assign a view value to the unit and notify it.
 
Transform the unit's attributs to a JSON string
Class Detail
Unit()
Class Unit
Author: Youness HAMRI - youness.hamri@gmail.com.
Method Detail
addProperty()
Adds a new properties to unit.
Parameters:
property.
Returns:
this.

hasProperty()
checks whether a property is present in the list of properties
Parameters:
property.
Returns:
true when a properties list contains a property and return false otherwise .

moveToCell()
Moves the unit to another cell,
Parameters:
cell.
a new cell that will contains the unit.

removeProperty()
Removes one property from a properties list.
Parameters:
property.
Returns:
this.

resetMovement()
Assign the maximun movement value to the unit.

setAttack()
The defense attack: assign a attack value to the unit and notify it.
Parameters:
attack.

setCell()
The cell setter: assign a cell to the unit and notify it.
Parameters:
cell.

setDefense()
The defense setter: assign a defense value to the unit and notify it.
Parameters:
defense.

setHealth()
The health setter: assign a health value to the unit and notify it.
Parameters:
health.

setMovement()
The movement setter: assign a movement value to the unit and notify it.
Parameters:
movement.

setRange()
The range setter: assign a range value to the unit and notify it.
Parameters:
range.

setView()
The view setter: assign a view value to the unit and notify it.
Parameters:
view.

toJSON()
Transform the unit's attributs to a JSON string
Returns:
data, contains the unit attributs.

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