| @@ 10-99 (lines=90) @@ | ||
| 7 | use Igorsgm\TibiaDataApi\Traits\ImmutableTrait; |
|
| 8 | use Igorsgm\TibiaDataApi\Traits\SerializableTrait; |
|
| 9 | ||
| 10 | class Guildhall |
|
| 11 | { |
|
| 12 | use ImmutableTrait, SerializableTrait; |
|
| 13 | ||
| 14 | /** |
|
| 15 | * @var string |
|
| 16 | */ |
|
| 17 | private $name; |
|
| 18 | ||
| 19 | /** |
|
| 20 | * @var string |
|
| 21 | */ |
|
| 22 | private $town; |
|
| 23 | ||
| 24 | /** |
|
| 25 | * @var Carbon |
|
| 26 | */ |
|
| 27 | private $paid; |
|
| 28 | ||
| 29 | /** |
|
| 30 | * @var string |
|
| 31 | */ |
|
| 32 | private $world; |
|
| 33 | ||
| 34 | /** |
|
| 35 | * @var int |
|
| 36 | */ |
|
| 37 | private $houseId; |
|
| 38 | ||
| 39 | /** |
|
| 40 | * Guildhall constructor. |
|
| 41 | * |
|
| 42 | * @param string $name |
|
| 43 | * @param string $town |
|
| 44 | * @param Carbon $paid |
|
| 45 | * @param string $world |
|
| 46 | * @param int $houseId |
|
| 47 | * @throws ImmutableException |
|
| 48 | */ |
|
| 49 | public function __construct(string $name, string $town, Carbon $paid, string $world, int $houseId) |
|
| 50 | { |
|
| 51 | $this->handleImmutableConstructor(); |
|
| 52 | ||
| 53 | $this->name = $name; |
|
| 54 | $this->town = $town; |
|
| 55 | $this->paid = $paid; |
|
| 56 | $this->world = $world; |
|
| 57 | $this->houseId = $houseId; |
|
| 58 | } |
|
| 59 | ||
| 60 | /** |
|
| 61 | * @return string |
|
| 62 | */ |
|
| 63 | public function getName(): string |
|
| 64 | { |
|
| 65 | return $this->name; |
|
| 66 | } |
|
| 67 | ||
| 68 | /** |
|
| 69 | * @return string |
|
| 70 | */ |
|
| 71 | public function getTown(): string |
|
| 72 | { |
|
| 73 | return $this->town; |
|
| 74 | } |
|
| 75 | ||
| 76 | /** |
|
| 77 | * @return Carbon |
|
| 78 | */ |
|
| 79 | public function getPaid(): Carbon |
|
| 80 | { |
|
| 81 | return $this->paid; |
|
| 82 | } |
|
| 83 | ||
| 84 | /** |
|
| 85 | * @return string |
|
| 86 | */ |
|
| 87 | public function getWorld(): string |
|
| 88 | { |
|
| 89 | return $this->world; |
|
| 90 | } |
|
| 91 | ||
| 92 | /** |
|
| 93 | * @return int |
|
| 94 | */ |
|
| 95 | public function getHouseId(): int |
|
| 96 | { |
|
| 97 | return $this->houseId; |
|
| 98 | } |
|
| 99 | } |
|
| 100 | ||
| @@ 9-105 (lines=97) @@ | ||
| 6 | use Igorsgm\TibiaDataApi\Traits\ImmutableTrait; |
|
| 7 | use Igorsgm\TibiaDataApi\Traits\SerializableTrait; |
|
| 8 | ||
| 9 | class House |
|
| 10 | { |
|
| 11 | use ImmutableTrait, SerializableTrait; |
|
| 12 | ||
| 13 | /** |
|
| 14 | * @var int |
|
| 15 | */ |
|
| 16 | private $houseId; |
|
| 17 | ||
| 18 | /** |
|
| 19 | * @var string |
|
| 20 | */ |
|
| 21 | private $name; |
|
| 22 | ||
| 23 | /** |
|
| 24 | * @var int |
|
| 25 | */ |
|
| 26 | private $size; |
|
| 27 | ||
| 28 | /** |
|
| 29 | * @var int |
|
| 30 | */ |
|
| 31 | private $rent; |
|
| 32 | ||
| 33 | /** |
|
| 34 | * @var string |
|
| 35 | */ |
|
| 36 | private $status; |
|
| 37 | ||
| 38 | /** |
|
| 39 | * House constructor. |
|
| 40 | * @param int $id |
|
| 41 | * @param string $name |
|
| 42 | * @param int $size |
|
| 43 | * @param int $rent |
|
| 44 | * @param string $status |
|
| 45 | * @throws ImmutableException |
|
| 46 | */ |
|
| 47 | public function __construct(int $id, string $name, int $size, int $rent, string $status) |
|
| 48 | { |
|
| 49 | $this->handleImmutableConstructor(); |
|
| 50 | ||
| 51 | $this->houseId = $id; |
|
| 52 | $this->name = $name; |
|
| 53 | $this->size = $size; |
|
| 54 | $this->rent = $rent; |
|
| 55 | $this->status = $status; |
|
| 56 | } |
|
| 57 | ||
| 58 | /** |
|
| 59 | * @return int |
|
| 60 | */ |
|
| 61 | public function getHouseId(): int |
|
| 62 | { |
|
| 63 | return $this->houseId; |
|
| 64 | } |
|
| 65 | ||
| 66 | /** |
|
| 67 | * @return string |
|
| 68 | */ |
|
| 69 | public function getName(): string |
|
| 70 | { |
|
| 71 | return $this->name; |
|
| 72 | } |
|
| 73 | ||
| 74 | /** |
|
| 75 | * @return int |
|
| 76 | */ |
|
| 77 | public function getSize(): int |
|
| 78 | { |
|
| 79 | return $this->size; |
|
| 80 | } |
|
| 81 | ||
| 82 | /** |
|
| 83 | * @return int |
|
| 84 | */ |
|
| 85 | public function getRent(): int |
|
| 86 | { |
|
| 87 | return $this->rent; |
|
| 88 | } |
|
| 89 | ||
| 90 | /** |
|
| 91 | * @return string |
|
| 92 | */ |
|
| 93 | public function getStatus(): string |
|
| 94 | { |
|
| 95 | return $this->status; |
|
| 96 | } |
|
| 97 | ||
| 98 | /** |
|
| 99 | * @return bool |
|
| 100 | */ |
|
| 101 | public function isRented() |
|
| 102 | { |
|
| 103 | return $this->status === 'rented'; |
|
| 104 | } |
|
| 105 | } |
|
| 106 | ||