| 1 | <?php |
||
| 5 | class Map |
||
| 6 | { |
||
| 7 | private $width; |
||
| 8 | private $height; |
||
| 9 | private $obstacles; |
||
| 10 | |||
| 11 | 2 | public function __construct(int $a_width, int $a_height, Obstacle ...$obstacles_array) |
|
| 17 | |||
| 18 | public function width(): int |
||
| 22 | |||
| 23 | public function height(): int |
||
| 27 | |||
| 28 | 2 | public function collideWithAnyObstacle(Position $a_position): bool |
|
| 40 | |||
| 41 | 2 | public function normalizePosition(Position $new_position): Position |
|
| 45 | } |