Великое объединение магазинов. #54.

This commit is contained in:
2023-07-29 00:18:04 +03:00
parent ad182a21fe
commit 9de7415f08
19 changed files with 1865 additions and 3125 deletions
+41
View File
@@ -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;
}
}