Total Complexity | 5 |
Total Lines | 61 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
5 | abstract class PlaceType |
||
6 | { |
||
7 | /** |
||
8 | * An identifier to recognize the node |
||
9 | * |
||
10 | * @var string |
||
11 | */ |
||
12 | protected $name; |
||
13 | |||
14 | /** |
||
15 | * Original Weight given on instantiation |
||
16 | * |
||
17 | * @var int |
||
18 | */ |
||
19 | protected $originalWeight = 0; |
||
20 | |||
21 | /** |
||
22 | * Place constructor. |
||
23 | * @param string $name |
||
24 | */ |
||
25 | public function __construct($name = "") |
||
28 | } |
||
29 | |||
30 | public function __toString() |
||
31 | { |
||
32 | return $this->getOriginalWeight(); |
||
33 | } |
||
34 | |||
35 | /** |
||
36 | * Describe if the place will be walkable or not |
||
37 | * |
||
38 | * @return boolean |
||
39 | */ |
||
40 | abstract public function isWalkable(); |
||
41 | |||
42 | /** |
||
43 | * @return string |
||
44 | */ |
||
45 | public function getName() |
||
46 | { |
||
47 | return $this->name; |
||
48 | } |
||
49 | |||
50 | /** |
||
51 | * @param string $name |
||
52 | * @return PlaceType |
||
53 | */ |
||
54 | public function setName($name) |
||
58 | } |
||
59 | |||
60 | /** |
||
61 | * @return int |
||
62 | */ |
||
63 | public function getOriginalWeight() |
||
66 | } |
||
67 | } |