Total Complexity | 8 |
Total Lines | 48 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
11 | class GridFactory |
||
12 | { |
||
13 | 3 | public static function create(Config $config) |
|
14 | { |
||
15 | 3 | self::setSeed($config); |
|
16 | |||
17 | 3 | $cells = self::getCells($config); |
|
18 | |||
19 | 3 | $neighbors = self::getNeighbors($config); |
|
20 | |||
21 | 3 | return new Grid($config, $cells, $neighbors); |
|
22 | } |
||
23 | |||
24 | 3 | protected static function setSeed(Config $config) |
|
25 | { |
||
26 | 3 | mt_srand($config->seed()); |
|
27 | 3 | } |
|
28 | |||
29 | 3 | protected static function getCells(Config $config) |
|
42 | } |
||
43 | |||
44 | 3 | protected static function getNeighbors(Config $config) |
|
59 | } |
||
60 | } |
||
61 |