The Dice primitive supplies a consistent way to get psuedo-random values into your game.
A dice instance can be found in the FrameContext object with 'max int' sides, and every frame the dice's seed value is set to the current running time of the game in milliseconds.
Dice also serve as a handy proxy to a number of functions found on a normal Random
instance, like alphanumeric, but with a predicatable seed.
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
Members list
Value members
Abstract methods
Roll an Int from 1 to the number of sides on the dice (inclusive)
Roll an Int from 1 to the number of sides on the dice (inclusive)
Attributes
Roll an Int from 1 to the specified number of sides (inclusive), using this dice instance as the seed.
Roll an Int from 1 to the specified number of sides (inclusive), using this dice instance as the seed.
Attributes
Produces an alphanumeric string of the specified length
Produces an alphanumeric string of the specified length
Attributes
Produces an alphanumeric string 16 characters long
Produces an alphanumeric string 16 characters long
Attributes
Produces a random Double from 0.0 to 1.0
Produces a random Double from 0.0 to 1.0
Attributes
Produces a random Float from 0.0f to 1.0f
Produces a random Float from 0.0f to 1.0f
Attributes
Roll an Int from 0 to the number of sides on the dice (inclusive)
Roll an Int from 0 to the number of sides on the dice (inclusive)
Attributes
Roll an Int from 0 to the specified number of sides (inclusive), using this dice instance as the seed.
Roll an Int from 0 to the specified number of sides (inclusive), using this dice instance as the seed.
Attributes
Roll an Int from the range provided (inclusive), using this dice instance as the seed.
Roll an Int from the range provided (inclusive), using this dice instance as the seed.
Attributes
The seed value of the dice. The dice supplied in the FrameContext
has the seed set to the current running time of the game in milliseconds.
The seed value of the dice. The dice supplied in the FrameContext
has the seed set to the current running time of the game in milliseconds.
Attributes
Shuffles a list of values into a random order
Shuffles a list of values into a random order
Attributes
Concrete methods
Produces a random Boolean
Produces a random Boolean
Attributes
Returns a string representation of the object.
Returns a string representation of the object.
The default representation is platform dependent.
Attributes
- Returns
-
a string representation of the object.
- Definition Classes
-
Any