use of pcgen.base.formula.base.DynamicDependency in project pcgen by PCGen.
the class DropIntoContext method getDependencies.
@Override
public void getDependencies(DependencyVisitor visitor, DependencyManager fdm, Node[] args) {
String legalScopeName = ((ASTQuotString) args[0]).getText();
TrainingStrategy ts = new TrainingStrategy();
DependencyManager trainer = fdm.getWith(DependencyManager.VARSTRATEGY, ts);
if (args[1] instanceof ASTQuotString) {
//Direct, no dependencies
} else if (args[1] instanceof ASTPCGenSingleWord) {
//Variable
args[1].jjtAccept(visitor, trainer);
} else {
//Error
}
DynamicDependency dd = new DynamicDependency(ts.getControlVar(), legalScopeName);
fdm.get(DependencyManager.DYNAMIC).addDependency(dd);
DependencyManager dynamic = fdm.getWith(DependencyManager.VARSTRATEGY, dd);
//Rest of Equation
args[2].jjtAccept(visitor, dynamic);
}
Aggregations