Бартер: начало.
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user