use of pcgen.base.formula.base.ScopeInstance in project pcgen by PCGen.
the class SolverManagerFacet method removeModifier.
public <T> void removeModifier(CharID id, VarModifier<T> vm, VarScoped target, ScopeInstance source) {
ScopeInstance scope = scopeFacet.get(id, vm.getLegalScope().getName(), target);
VariableID<T> varID = (VariableID<T>) variableLibraryFacet.getVariableID(id.getDatasetID(), scope, vm.getVarName());
get(id).removeModifier(varID, vm.getModifier(), source);
}
use of pcgen.base.formula.base.ScopeInstance in project pcgen by PCGen.
the class PlayerCharacter method addModifier.
public <T> void addModifier(VarModifier<T> modifier, VarScoped vs, VarScoped source) {
ScopeInstance inst = scopeFacet.get(id, source.getLocalScopeName(), source);
solverManagerFacet.addModifier(id, modifier, vs, inst);
}
use of pcgen.base.formula.base.ScopeInstance in project pcgen by PCGen.
the class GlobalVarModel method get.
/**
* Gets the global variable (new formula system) represented by the given
* key.
*
* @see freemarker.template.TemplateHashModel#get(java.lang.String)
*/
@Override
public TemplateModel get(String varName) throws TemplateModelException {
ScopeInstance varScope = scopeFacet.getGlobalScope(id);
VariableID<?> varID = variableLibraryFacet.getVariableID(id.getDatasetID(), varScope, varName);
Object value = variableStoreFacet.getValue(id, varID);
return wrapperFacet.wrap(id, value);
}
use of pcgen.base.formula.base.ScopeInstance in project pcgen by PCGen.
the class VariableActor method process.
@Override
public TemplateModel process(CharID id, CDOMObject obj) throws TemplateModelException {
ScopeInstance varScope = scopeFacet.getGlobalScope(id);
VariableID<?> varID = variableLibraryFacet.getVariableID(id.getDatasetID(), varScope, varName);
Object value = variableStoreFacet.getValue(id, varID);
return wrapperFacet.wrap(id, value);
}
use of pcgen.base.formula.base.ScopeInstance in project pcgen by PCGen.
the class SolverViewFrame method update.
private void update() {
updateObjects();
ScopeInstance scope = scopeFacet.get(activeIdentifier, selectedScope.getName(), activeObject);
if (variableLibraryFacet.isLegalVariableName(activeIdentifier.getDatasetID(), scope.getLegalScope(), varNameText)) {
displayInfo(scope);
} else {
//TODO Update a status bar
System.err.println(selectedScope.getName() + " does not have a variable: " + varNameText);
}
}
Aggregations