def grow

bendvy-ecs-core@0.1.0.3 · column.bend:149

import bendvy-ecs-core@0.1.0.3/column.bend as Column
import Base
import lifecycle.bend as L

149def grow(~S: Data, ~C: Type, fuel: Nat, values: Array<Maybe<&1,C>>, +stamps: List<&2,L.Entry>, +size: U32, +depth: Nat, +target: U32, enough: Bool) -> Column<S,C>:
150  match fuel enough:
151    case _ True{}:
152      Column{values,stamps}
153    case 0n False{}:
154      Column{values,stamps}
155    case 1n+rest False{}:
156      +next = U32.shl(size)
157      grow(~S, ~C, rest, ANode{values, absent(~C, depth)}, stamps, next, 1n+depth, target, U32.is_le(target, next))

Uses (11)

Used by (1)