optimize props generation

This commit is contained in:
Hash Borgir 2023-06-14 13:56:16 -06:00
parent 64daee85bb
commit 4f6322e866

View File

@ -9,6 +9,7 @@ class D2ItemData {
* @var
*/
public $strings;
/**
* @var
*/
@ -59,39 +60,18 @@ class D2ItemData {
$res['invfile'] = $invfile;
$return = $res;
// for all props for this unique item, get ISC strings
$props = array_filter([
"Prop1" => array_filter(
["prop1" => $return['prop1'], "par1" => $return['par1'], "min1" => $return['min1'], "max1" => $return['max1']]
),
"Prop2" => array_filter(
["prop2" => $return['prop2'], "par1" => $return['par2'], "min1" => $return['min2'], "max1" => $return['max2']]
),
"Prop3" => array_filter(
["prop3" => $return['prop3'], "par1" => $return['par3'], "min1" => $return['min3'], "max1" => $return['max3']]
),
"Prop4" => array_filter(
["prop4" => $return['prop4'], "par1" => $return['par4'], "min1" => $return['min4'], "max1" => $return['max4']]
),
"Prop5" => array_filter(
["prop5" => $return['prop5'], "par1" => $return['par5'], "min1" => $return['min5'], "max1" => $return['max5']]
),
"Prop6" => array_filter(
["prop6" => $return['prop6'], "par1" => $return['par6'], "min1" => $return['min6'], "max1" => $return['max6']]
),
"Prop7" => array_filter(
["prop7" => $return['prop7'], "par1" => $return['par7'], "min1" => $return['min7'], "max1" => $return['max7']]
),
"Prop8" => array_filter(
["prop8" => $return['prop8'], "par1" => $return['par8'], "min1" => $return['min8'], "max1" => $return['max8']]
),
"Prop9" => array_filter(
["prop9" => $return['prop9'], "par1" => $return['par9'], "min1" => $return['min9'], "max1" => $return['max9']]
),
"Prop10" => array_filter(
["prop10" => $return['prop10'], "par1" => $return['par10'], "min1" => $return['min10'], "max1" => $return['max10']]
)
// For all props for this unique item, get ISC strings
$props = [];
for ($i = 1; $i <= 10; $i++) {
$propName = "Prop$i";
$props[$propName] = array_filter([
"prop$i" => $return["prop$i"],
"par1" => $return["par$i"],
"min1" => $return["min$i"],
"max1" => $return["max$i"]
]);
}
// need par, min, max value for each prop
// ( Also need func1 and val1 for each prop )