| 1 | <?php |
||
| 9 | class Character |
||
| 10 | { |
||
| 11 | use ImmutableTrait, SerializableTrait; |
||
| 12 | |||
| 13 | /** |
||
| 14 | * @var string |
||
| 15 | */ |
||
| 16 | private $name; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @var string |
||
| 20 | */ |
||
| 21 | private $vocation; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @var int |
||
| 25 | */ |
||
| 26 | private $level; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Character constructor. |
||
| 30 | * @param string $name |
||
| 31 | * @param int $level |
||
| 32 | * @param string $vocation |
||
| 33 | * @throws ImmutableException |
||
| 34 | */ |
||
| 35 | public function __construct(string $name, int $level, string $vocation) |
||
| 43 | |||
| 44 | /** |
||
| 45 | * @return string |
||
| 46 | */ |
||
| 47 | public function getName(): string |
||
| 51 | |||
| 52 | /** |
||
| 53 | * @return string |
||
| 54 | */ |
||
| 55 | public function getVocation(): string |
||
| 59 | |||
| 60 | /** |
||
| 61 | * @return int |
||
| 62 | */ |
||
| 63 | public function getLevel(): int |
||
| 67 | } |
||
| 68 |