Удалён зодиак. Фиксы перехода php7.2 -> php7.4. Покупка и продажа за банкноты (#25). Унификация вывода кнопок в магазине. Удалён старый закомментированый код. Больше констант. Плавная текучка от библиотеки db::c в сторону DBPDO. И тому подобное. Процесс идёт...
This commit is contained in:
@@ -7,17 +7,16 @@
|
||||
|
||||
namespace Battles;
|
||||
|
||||
use Config;
|
||||
use Exceptions\GameException;
|
||||
use Battles\Database\DBPDO;
|
||||
use Throwable;
|
||||
|
||||
class Bank
|
||||
{
|
||||
public $user_id;
|
||||
private $money;
|
||||
public int $user_id = 0;
|
||||
private int $money = 0;
|
||||
private $user;
|
||||
private static $db;
|
||||
private static DBPDO $db;
|
||||
|
||||
const ERROR_NO_MONEY_IN_WALLET = "Ошибка! Нет денег в кошельке!";
|
||||
const ERROR_NO_BANK_ACCOUNT = "Ошибка! Счёта не существует!";
|
||||
@@ -174,11 +173,11 @@ class Bank
|
||||
self::setBankMoney($this->money, $this->user_id);
|
||||
$this->bankLogs(0, $this->money, "withdrawMoney");
|
||||
// Отдаём сумму в кошелёк получателя
|
||||
$this->user->money += $amount;
|
||||
self::setWalletMoney($this->user->money, $this->user_id);
|
||||
$this->user['money'] += $amount;
|
||||
self::setWalletMoney($this->user['money'], $this->user_id);
|
||||
// Возвращаем изменившиеся значения
|
||||
return [
|
||||
'walletMoney' => $this->user->money,
|
||||
'walletMoney' => $this->user['money'],
|
||||
'bankMoney' => $this->money
|
||||
];
|
||||
}
|
||||
@@ -223,7 +222,7 @@ class Bank
|
||||
|
||||
}
|
||||
|
||||
public function getMoney()
|
||||
public function getMoney(): int
|
||||
{
|
||||
return $this->money;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user