2023-07-28 21:18:04 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Item\Data;
|
|
|
|
|
|
|
|
class Properties
|
|
|
|
{
|
2023-11-02 13:57:39 +00:00
|
|
|
public static array $names = [
|
2023-07-28 21:18:04 +00:00
|
|
|
'damage' => 'Урон',
|
|
|
|
];
|
|
|
|
private array $result = [];
|
|
|
|
|
|
|
|
public function __construct(array $data)
|
|
|
|
{
|
|
|
|
$this->damage($data);
|
|
|
|
}
|
|
|
|
|
|
|
|
private function damage(array $data): void
|
|
|
|
{
|
|
|
|
$min = 0;
|
|
|
|
$max = 0;
|
|
|
|
if (!empty($data['yron_min'])) {
|
|
|
|
$min = $data['yron_min'];
|
|
|
|
$max = $data['yron_min'];
|
|
|
|
}
|
|
|
|
if (!empty($data['yron_max'])) {
|
|
|
|
if (empty($data['yron_min'])) {
|
|
|
|
$min = $data['yron_max'];
|
|
|
|
}
|
|
|
|
$max = $data['yron_max'];
|
|
|
|
}
|
|
|
|
if (empty($min) && empty($max)) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
$this->result[self::$names['damage']] = $min . ' - ' . $max;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function get(): array
|
|
|
|
{
|
|
|
|
return $this->result;
|
|
|
|
}
|
|
|
|
}
|