| 1 | <?php |
||
| 5 | class Cell |
||
| 6 | { |
||
| 7 | /** @var Config */ |
||
| 8 | protected $config; |
||
| 9 | |||
| 10 | /** @var int */ |
||
| 11 | protected $state; |
||
| 12 | |||
| 13 | /** @var int */ |
||
| 14 | protected $nextState; |
||
| 15 | |||
| 16 | 12 | public function __construct(Config $config) |
|
| 22 | |||
| 23 | 12 | protected function getRandomState(): int |
|
| 27 | |||
| 28 | 12 | public function getState(): int |
|
| 32 | |||
| 33 | 6 | public function computeNextState(array $neighborStates) |
|
| 46 | |||
| 47 | 6 | protected function getSuccessorState(): int |
|
| 51 | |||
| 52 | 6 | protected function willCycle(int $count): bool |
|
| 56 | |||
| 57 | 6 | public function setNextState() |
|
| 61 | |||
| 62 | 3 | public function __toString(): string |
|
| 66 | } |
||
| 67 |