1 | <?php |
||
5 | class Orientation |
||
|
|||
6 | { |
||
7 | private $orientation; |
||
8 | |||
9 | 1 | private function __construct(string $orientation) |
|
13 | |||
14 | 1 | public static function NORTH(): Orientation |
|
18 | |||
19 | public static function SOUTH(): Orientation |
||
23 | |||
24 | 1 | public static function EAST(): Orientation |
|
28 | |||
29 | public static function WEST(): Orientation |
||
33 | |||
34 | 2 | public function isNorth(): bool |
|
38 | |||
39 | 2 | public function isSouth(): bool |
|
43 | |||
44 | 2 | public function isEast(): bool |
|
48 | |||
49 | 1 | public function isWest(): bool |
|
53 | |||
54 | 1 | public function turn(Movement $movement): Orientation |
|
76 | } |