Refactor: rewrite itemFitsInto1By2Slot to improve readability
This commit is contained in:
parent
a6838e9312
commit
1659211080
@ -297,7 +297,7 @@ export class BotGenerator
|
||||
|
||||
/**
|
||||
* Get a bots skills with randomsied progress value between the min and max values
|
||||
* @param botSkills
|
||||
* @param botSkills Skills that should have their progress value randomised
|
||||
* @returns
|
||||
*/
|
||||
protected generateSkills(botSkills: botSkills): botSkills
|
||||
|
@ -105,33 +105,24 @@ export class PMCLootGenerator
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if item has a width/hide that lets it fit into a 1x2 slot
|
||||
* Check if item has a width/height that lets it fit into a 1x2/2x1 slot
|
||||
* 1x1 / 1x2 / 2x1
|
||||
* @param item Item to check size of
|
||||
* @returns true if it fits
|
||||
*/
|
||||
protected itemFitsInto1By2Slot(item: ITemplateItem): boolean
|
||||
{
|
||||
if (item._props.Width === 1
|
||||
&& item._props.Height === 1)
|
||||
switch (`{${item._props.Width}x${item._props.Height}}`)
|
||||
{
|
||||
case "1x1":
|
||||
case "1x2":
|
||||
case "2x1":
|
||||
return true;
|
||||
}
|
||||
|
||||
if (item._props.Width === 1
|
||||
&& item._props.Height === 2)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (item._props.Width === 2
|
||||
&& item._props.Height === 1)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an array of loot items a PMC can have in their backpack
|
||||
|
Loading…
Reference in New Issue
Block a user