From 77081db3a7b2a290217dae55e570b4d782ced2c2 Mon Sep 17 00:00:00 2001 From: "Igor Barkov [iwork]" Date: Mon, 14 Jan 2019 16:31:42 +0200 Subject: [PATCH] make class greater --- classes/Item.php | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/classes/Item.php b/classes/Item.php index bfac5d8..1db916f 100644 --- a/classes/Item.php +++ b/classes/Item.php @@ -2,14 +2,19 @@ abstract class Item { + public $id; public $name; - public $massa; public $nalign; + public $massa; + public $duration; public $maxdur; public $img; + public $count; + public $razdel; + public $cost; + public $ecost; public $type; # эти. что есть что нет... - private $typename; public $nlevel; public $nsila; @@ -60,9 +65,23 @@ abstract class Item public $mfuvorot; public $mfauvorot; + public $shshop; + public $dategoden; + public $goden; + public $needident; public $magic; public $magic_name; public $magic_img; + public $letter; + public $isrep; + public $gmp; + public $gmeshok; + public $zeton; + public $encicl; + public $onlyone; + public $koll; + public $prof; + public $prof1; /** * Item constructor. @@ -71,10 +90,10 @@ abstract class Item */ public function __construct($row) { - foreach ($this as $key=>$value) { - if (!empty($key)) { - $this->$key = $row[$key]; - } + foreach ($this as $key => $value) { + + $this->$key = $row[$key]; + } // ТА ЛААААДНО?! @@ -246,11 +265,11 @@ IMG; protected function printMagic() { - if ($this->magic) { + if ($this->magic AND $this->type != 12) { echo "
Магические свойства:"; if ($this->magic_name) echo "
{$this->magic_name}"; else echo "
Неопознанная магия"; - if ($this->magic_img) echo <<magic_img AND $this->type != 50) echo << IMG; }