Бартер: начало.

This commit is contained in:
Igor Barkov (iwork)
2021-08-30 19:30:56 +03:00
parent 198092b44a
commit 2760e17c6b
2 changed files with 117 additions and 49 deletions
+8 -1
View File
@@ -1,6 +1,8 @@
<?php
namespace Battles;
use Battles\Database\DBPDO;
class Item
{
protected int $item_id;
@@ -108,7 +110,7 @@ class Item
/** Рассчёт стоимости предмета в зависимости от его характеристик.
* @return int
*/
private function calculateItemCost(): int
protected function calculateItemCost(): int
{
$sum_stats =
$this->add_strength +
@@ -188,4 +190,9 @@ class Item
}
return $str;
}
public static function getItemById($item_id): Item
{
return new Item(DBPDO::$db->ofetch('select * from items where id = ?', $item_id));
}
}