Skip to content

five-on-it / apps/tools/src/region-level / trimToBudget

Function: trimToBudget() ​

trimToBudget(recipe, props, triangles, budget?): string[]

Defined in: apps/tools/src/region-level.ts:302

Takes the region's details that may go (props with a trim rank) out of a recipe until it holds no more than REGION_BUDGET of placements and triangles (triangles of a kit/piece): the highest rank first, in an order spread over the map. Returns the names taken out; the recipe is changed in place.

Parameters ​

recipe ​

dummies ​

object[] = ...

groundHalfSize ​

number = ...

kits ​

string[] = ...

nailStrips ​

object[] = ...

name ​

string = ...

placements ​

object[] = ...

roads ​

object[] = ...

spawns ​

object[] = ...

props ​

readonly RegionProp[]

triangles ​

(piece) => number

budget? ​

placements ​

number

triangles ​

number

Returns ​

string[]