Skip to content

five-on-it / packages/world/src/pieces / parseWeights

Function: parseWeights() ​

parseWeights(node, text): Record<string, number>

Defined in: packages/world/src/pieces.ts:587

The weights a district block's pedestrians text gives: roles separated by spaces or commas, each with an optional *<weight> (commuter*6, jogger*1.5); empty for none; throws naming the node for anything else.

Parameters ​

node ​

string

text ​

string

Returns ​

Record<string, number>