-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathRandomNumberGeneratorAdapter.php
More file actions
35 lines (25 loc) · 953 Bytes
/
RandomNumberGeneratorAdapter.php
File metadata and controls
35 lines (25 loc) · 953 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
namespace Skywarth\ChaoticSchedule\RNGs\Adapters;
use Skywarth\ChaoticSchedule\Exceptions\InvalidSeedFormatException;
interface RandomNumberGeneratorAdapter
{
public function __construct(?int $seed=null);//TODO: maybe make seed into string ?
public function setSeed(int $seed):RandomNumberGeneratorAdapter;
public function getSeed():int;
//Boundaries are inclusive
//E.g: [1,3]-> {1,2,3}
//Make sure to follow this fashion accordingly per adapter.
/**
* @param int $floor Inclusive, floor/minimum value for the random value
* @param int $ceil Inclusive, ceil/maximum value for the random value
* @return int
*/
public function intBetween(int $floor, int $ceil):int;
public static function getAdapterSlug():string;
public function getSlug():string;
/**
* @return bool
* @throws InvalidSeedFormatException
*/
public function validateSeed(int $seed):bool;
}