2022-02-05 03:35:42 +00:00
|
|
|
<?php
|
|
|
|
namespace Makai;
|
|
|
|
|
2023-10-12 18:45:11 +00:00
|
|
|
use Index\Colour\Colour;
|
|
|
|
use Index\Colour\ColourRGB;
|
2022-02-05 03:35:42 +00:00
|
|
|
|
|
|
|
class LanguageInfo {
|
2022-02-06 01:36:05 +00:00
|
|
|
private string $id;
|
2023-10-12 18:52:24 +00:00
|
|
|
private string $name;
|
2022-02-05 03:35:42 +00:00
|
|
|
private ?int $colour;
|
|
|
|
|
|
|
|
public function __construct(
|
2022-02-06 01:36:05 +00:00
|
|
|
string $id,
|
2023-10-12 18:52:24 +00:00
|
|
|
string $name,
|
2022-02-05 03:35:42 +00:00
|
|
|
?int $colour
|
|
|
|
) {
|
|
|
|
$this->id = $id;
|
|
|
|
$this->name = $name;
|
|
|
|
$this->colour = $colour;
|
|
|
|
}
|
|
|
|
|
2022-02-06 01:36:05 +00:00
|
|
|
public function getId(): string {
|
2022-02-05 03:35:42 +00:00
|
|
|
return $this->id;
|
|
|
|
}
|
|
|
|
|
2023-10-12 18:52:24 +00:00
|
|
|
public function getName(): string {
|
2022-02-05 03:35:42 +00:00
|
|
|
return $this->name;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function hasColour(): bool {
|
|
|
|
return $this->colour !== null;
|
|
|
|
}
|
|
|
|
|
2023-10-12 18:45:11 +00:00
|
|
|
public function getColour(): Colour {
|
|
|
|
return $this->colour === null ? Colour::none() : ColourRGB::fromRawRGB($this->colour);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getColourRaw(): ?int {
|
2022-02-05 03:35:42 +00:00
|
|
|
return $this->colour;
|
|
|
|
}
|
|
|
|
}
|