PocketMine-MP  1.4 - API 1.10.0
 All Classes Namespaces Functions Variables Pages
pocketmine\utils\Random Class Reference
+ Collaboration diagram for pocketmine\utils\Random:

Public Member Functions

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

Protected Attributes

 $seed
 

Detailed Description

Unsecure Random Number Generator, used for fast seeded values WARNING: This class is available on the PocketMine-MP Zephir project. If this class is modified, remember to modify the PHP C extension.

Definition at line 30 of file Random.php.

Constructor & Destructor Documentation

pocketmine\utils\Random::__construct (   $seed = -1)
Parameters
int$seedInteger to be used as seed.

Definition at line 37 of file Random.php.

References pocketmine\utils\Random\setSeed().

+ Here is the call graph for this function:

Member Function Documentation

pocketmine\utils\Random::nextBoolean ( )

Returns a random boolean

Returns
bool

Definition at line 100 of file Random.php.

References pocketmine\utils\Random\nextSignedInt().

+ Here is the call graph for this function:

pocketmine\utils\Random::nextFloat ( )

Returns a float between 0.0 and 1.0 (inclusive)

Returns
float

Definition at line 82 of file Random.php.

References pocketmine\utils\Random\nextInt().

+ Here is the call graph for this function:

pocketmine\utils\Random::nextInt ( )

Returns an 31-bit integer (not signed)

Returns
int

Definition at line 57 of file Random.php.

References pocketmine\utils\Random\nextSignedInt().

Referenced by pocketmine\utils\Random\nextFloat(), and pocketmine\utils\Random\nextRange().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

pocketmine\utils\Random::nextRange (   $start = 0,
  $end = 0x7fffffff 
)

Returns a random integer between $start and $end

Parameters
int$startdefault 0
int$enddefault 0x7fffffff
Returns
int

Definition at line 112 of file Random.php.

References pocketmine\utils\Random\nextInt().

+ Here is the call graph for this function:

pocketmine\utils\Random::nextSignedFloat ( )

Returns a float between -1.0 and 1.0 (inclusive)

Returns
float

Definition at line 91 of file Random.php.

References pocketmine\utils\Random\nextSignedInt().

+ Here is the call graph for this function:

pocketmine\utils\Random::nextSignedInt ( )

Returns a 32-bit integer (signed)

Returns
int

Definition at line 66 of file Random.php.

Referenced by pocketmine\utils\Random\nextBoolean(), pocketmine\utils\Random\nextInt(), and pocketmine\utils\Random\nextSignedFloat().

+ Here is the caller graph for this function:

pocketmine\utils\Random::setSeed (   $seed)
Parameters
int$seedInteger to be used as seed.

Definition at line 48 of file Random.php.

Referenced by pocketmine\utils\Random\__construct().

+ Here is the caller graph for this function:


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