Class DynamicVirtualNumberValue
An implementation of DynamicVirtualValue which stores a number.
Stack modes
Add
: Returnslhs + rhs
, default base value is0
Mult
: Returnslhs * rhs
, default base value is1
Usage
local dvnv = DynamicVirtualNumberValue.new("Add") dvnv:newChild(1) dvnv:newChild(2) dvnv:newChild(3) print(dvnv:get()) --> 0+1+2+3=6 local dvnv2 = DynamicVirtualNumberValue.new("Mult", 4) dvnv2:newChild(5) print(dvnv2:get()) --> 4*5=20 dvnv:addChild(dvnv2) print(dvnv:get()) --> 0+1+2+3+(4*5)=26