42 lines
873 B
PHP
42 lines
873 B
PHP
<?php
|
|
|
|
namespace Item\Data;
|
|
|
|
class Properties
|
|
{
|
|
public static array $names = [
|
|
'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;
|
|
}
|
|
}
|