Великое объединение магазинов. #54.
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace Item\Data;
|
||||
|
||||
class Properties
|
||||
{
|
||||
private 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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user