Structure/Types

* move distributed constant values to object
 * move reused iterators and checks to object
This commit is contained in:
Sarjuuk
2022-03-21 15:20:31 +01:00
parent e109a6deed
commit 33a870ef78
126 changed files with 970 additions and 885 deletions

View File

@@ -102,7 +102,7 @@ class ItemStatSetup extends ItemList
// collect data and write to DB
foreach ($this->iterate() as $__)
{
$updateFields = ['type' => TYPE_ITEM, 'typeId' => $this->id];
$updateFields = ['type' => Type::ITEM, 'typeId' => $this->id];
foreach (@$this->json[$this->id] as $k => $v)
{
@@ -228,7 +228,7 @@ SqlGen::register(new class extends SetupScript
Util::arraySumByKey($result[$eId], [$str => $val]);
}
$updateCols = ['type' => TYPE_ENCHANTMENT, 'typeId' => $eId];
$updateCols = ['type' => Type::ENCHANTMENT, 'typeId' => $eId];
foreach ($result[$eId] as $k => $v)
{
if (!in_array($k, $statCols) || !$v || $k == 'id')