evaluate method
Evaluates this expression according to given type and context.
Implementation
@override
dynamic evaluate(EvaluationType type, ContextModel context) {
final dynamic firstEval = first.evaluate(type, context);
final dynamic secondEval = second.evaluate(type, context);
if (type == EvaluationType.VECTOR) {
if (secondEval is double) {
// scale - nothing special to do
} else {
// multiply
final dynamic eval = firstEval.clone()..multiply(secondEval);
return eval;
}
}
return firstEval * secondEval;
}