| 
    PocketMine-MP 5.37.1 git-cef37e7835c666594588f957a47b27d521c6a58e
    
   | 
 
 Collaboration diagram for pocketmine\utils\Random:Public Member Functions | |
| __construct (int $seed=-1) | |
| getSeed () | |
| nextBoolean () | |
| nextBoundedInt (int $bound) | |
| nextFloat () | |
| nextInt () | |
| nextRange (int $start=0, int $end=0x7fffffff) | |
| nextSignedFloat () | |
| nextSignedInt () | |
| setSeed (int $seed) | |
Public Attributes | |
| const | W = 88675123 | 
| const | X = 123456789 | 
| const | Y = 362436069 | 
| const | Z = 521288629 | 
Protected Attributes | |
| int | $seed | 
XorShift128Engine Random Number Noise, used for fast seeded values Most of the code in this class was adapted from the XorShift128Engine in the php-random library.
Definition at line 32 of file Random.php.
| pocketmine\utils\Random::__construct | ( | int | $seed = -1 | ) | 
| int | $seed | Integer to be used as seed. | 
Definition at line 48 of file Random.php.
References pocketmine\utils\Random\setSeed().
 Here is the call graph for this function:| pocketmine\utils\Random::getSeed | ( | ) | 
Definition at line 67 of file Random.php.
| pocketmine\utils\Random::nextBoolean | ( | ) | 
Returns a random boolean
Definition at line 109 of file Random.php.
| pocketmine\utils\Random::nextBoundedInt | ( | int | $bound | ) | 
Definition at line 123 of file Random.php.
| pocketmine\utils\Random::nextFloat | ( | ) | 
Returns a float between 0.0 and 1.0 (inclusive)
Definition at line 95 of file Random.php.
| pocketmine\utils\Random::nextInt | ( | ) | 
Returns an 31-bit integer (not signed)
Definition at line 74 of file Random.php.
| pocketmine\utils\Random::nextRange | ( | int | $start = 0, | 
| int | $end = 0x7fffffff ) | 
Returns a random integer between $start and $end
| int | $start | default 0 | 
| int | $end | default 0x7fffffff | 
Definition at line 119 of file Random.php.
| pocketmine\utils\Random::nextSignedFloat | ( | ) | 
Returns a float between -1.0 and 1.0 (inclusive)
Definition at line 102 of file Random.php.
| pocketmine\utils\Random::nextSignedInt | ( | ) | 
Returns a 32-bit integer (signed)
Definition at line 81 of file Random.php.
| pocketmine\utils\Random::setSeed | ( | int | $seed | ) | 
| int | $seed | Integer to be used as seed. | 
Definition at line 59 of file Random.php.
Referenced by pocketmine\utils\Random\__construct().
 Here is the caller graph for this function:
      
  | 
  protected | 
Definition at line 43 of file Random.php.
| const pocketmine\utils\Random::W = 88675123 | 
Definition at line 36 of file Random.php.
| const pocketmine\utils\Random::X = 123456789 | 
Definition at line 33 of file Random.php.
| const pocketmine\utils\Random::Y = 362436069 | 
Definition at line 34 of file Random.php.
| const pocketmine\utils\Random::Z = 521288629 | 
Definition at line 35 of file Random.php.