flash.moe/src/LanguageInfo.php

44 lines
872 B
PHP
Raw Normal View History

2022-02-05 03:35:42 +00:00
<?php
namespace Makai;
use Index\AString;
use Index\WString;
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;
2022-02-05 03:35:42 +00:00
private WString $name;
private ?int $colour;
public function __construct(
2022-02-06 01:36:05 +00:00
string $id,
2022-02-05 03:35:42 +00:00
WString $name,
?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;
}
public function getName(): WString {
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;
}
}