| Package | wk.example.die.model |
| Class | public class ModelDie |
| Inheritance | ModelDie wk.mvcs.model.WK_Model_CS |
| Implements | IModelDie |
| Property | Defined By | ||
|---|---|---|---|
| state : String [read-only]
The state of the die:
ROLLING, i.e., the die is currently rolling,
or THROWN, i.e., the die has been thrown
and until the next throw the value does not change,
or NO_VALUE, i.e. | ModelDie | ||
| value : uint
The value of the die: 1 .. | ModelDie | ||
| Method | Defined By | ||
|---|---|---|---|
ModelDie() | ModelDie | ||
rollTheDie():void
If the die is currently not ROLLING, it starts
ROLLING. | ModelDie | ||
| state | property |
state:String [read-only]
The state of the die:
ROLLING, i.e., the die is currently rolling,
or THROWN, i.e., the die has been thrown
and until the next throw the value does not change,
or NO_VALUE, i.e. the die is in a box and no value
(0, to be more precisely) is displayed.
public function get state():String| value | property |
value:uint
The value of the die: 1 .. 6
and 0 (when state == NO_VALUE).
It can only be set if the die currently is not ROLLING.
public function get value():uint public function set value(value:uint):void| ModelDie | () | Constructor |
public function ModelDie()| rollTheDie | () | method |
public function rollTheDie():void
If the die is currently not ROLLING, it starts
ROLLING. For NUMBER_OF_ROLLS times
(with a delay time of DELAY ms after each roll)
a new random value is computed for the die. Thereafter the
state is switched to THROWN.