PocketMine
Random Class Reference

Public Member Functions

 __construct ($seed=-1)
 
 setSeed ($seed)
 
 nextInt ()
 
 nextSignedInt ()
 
 nextFloat ()
 
 nextSignedFloat ()
 
 nextBoolean ()
 
 nextRange ($start=0, $end=0x7fffffff)
 
 nextBoundedInt ($bound)
 

Protected Attributes

 $seed
 

Detailed Description

Unsecure Random Number Noise, used for fast seeded values

Constructor & Destructor Documentation

__construct (   $seed = -1)
Parameters
int$seedInteger to be used as seed.

Member Function Documentation

nextBoolean ( )

Returns a random boolean

Returns
bool
nextFloat ( )

Returns a float between 0.0 and 1.0 (inclusive)

Returns
float
nextInt ( )

Returns an 31-bit integer (not signed)

Returns
int
nextRange (   $start = 0,
  $end = 0x7fffffff 
)

Returns a random integer between $start and $end

Parameters
int$startdefault 0
int$enddefault 0x7fffffff
Returns
int
nextSignedFloat ( )

Returns a float between -1.0 and 1.0 (inclusive)

Returns
float
nextSignedInt ( )

Returns a 32-bit integer (signed)

Returns
int
setSeed (   $seed)
Parameters
int$seedInteger to be used as seed.

The documentation for this class was generated from the following file: