Right now I have a hierarchy as follows (->
means parent of )
LSystem -> DLSystem -> Tree -> MonopodialTree
-> TernaryTree
And I have a function substitute which is defined in LSystem as follows and given a minimal implementation that LSystem
, DLSystem
and Tree
use.
virtual void substitute(Symbol s, std::vector<Symbol> &string);
Next, MonopodialTree
and TernaryTree
override the definition of substitute.
The problem arises because I want to have a std::vector<Tree>
(with both Monopodial and Ternary) and iterate through it calling substitute for each one of them.
However, they both call LSystem
's substitute function instead of their own substitute function, what am I missing?