Skip to main content

Module primitive

Module primitive 

Source
Expand description

Engine primitives — the fixed vocabulary of effects the tree can produce.

Each tree node is a Vec<Primitive> where each primitive is a triple of (Op, Target, magnitude). Op + Target are code-defined enums (the engine needs to dispatch on them); the composition, count, target, magnitude, and sign of each primitive at a given lot are 100% procgen.

Adding a new primitive variant: append to Op or Target, add a fold case in aggregate.rs::TreeAggregate::fold_in, and add a render case in naming.rs. There’s no other table to update.

Structs§

Primitive
A single tree-node effect contribution.

Enums§

Op
What math the primitive performs. Sign of magnitude decides boon vs bane: a MulFactor with magnitude < 1.0 is a debuff, > 1.0 a buff.
Target
What the primitive operates on. The full set of game-touchable axes — any effect we want the tree to express has to map to one of these.