Search in sources :

Example 11 with RuntimeReferenceContext

use of pcgen.rules.context.RuntimeReferenceContext in project pcgen by PCGen.

the class AbstractPCClassLevelTokenTestCase method setUp.

@Override
@Before
public void setUp() throws PersistenceLayerException, URISyntaxException {
    if (!classSetUpFired) {
        classSetUp();
    }
    // Yea, this causes warnings...
    TokenRegistration.register(getToken());
    primaryContext = new RuntimeLoadContext(new RuntimeReferenceContext(), new ConsolidatedListCommitStrategy());
    secondaryContext = new RuntimeLoadContext(new RuntimeReferenceContext(), new ConsolidatedListCommitStrategy());
    primaryProf = primaryContext.getReferenceContext().constructCDOMObject(PCClass.class, "TestObj");
    secondaryProf = secondaryContext.getReferenceContext().constructCDOMObject(PCClass.class, "TestObj");
    primaryProf1 = primaryProf.getOriginalClassLevel(1);
    primaryProf2 = primaryProf.getOriginalClassLevel(2);
    primaryProf3 = primaryProf.getOriginalClassLevel(3);
    secondaryProf1 = secondaryProf.getOriginalClassLevel(1);
    secondaryProf2 = secondaryProf.getOriginalClassLevel(2);
    secondaryProf3 = secondaryProf.getOriginalClassLevel(3);
}
Also used : ConsolidatedListCommitStrategy(pcgen.rules.context.ConsolidatedListCommitStrategy) RuntimeReferenceContext(pcgen.rules.context.RuntimeReferenceContext) PCClass(pcgen.core.PCClass) RuntimeLoadContext(pcgen.rules.context.RuntimeLoadContext) Before(org.junit.Before)

Example 12 with RuntimeReferenceContext

use of pcgen.rules.context.RuntimeReferenceContext in project pcgen by PCGen.

the class SelectableTokenIntegrationTest method resetContext.

private void resetContext() {
    URI testURI = testCampaign.getURI();
    context = new RuntimeLoadContext(new RuntimeReferenceContext(), new ConsolidatedListCommitStrategy());
    context.setSourceURI(testURI);
    context.setExtractURI(testURI);
    cd = new FactDefinition();
    cd.setDisplayName(PROP_1);
    cd.setFormatManager(STRING_MGR);
    cd.setName(PROP_1);
    cd.setFactName(PROP_1);
    cd.setUsableLocation(Domain.class);
    cd.setVisibility(Visibility.DEFAULT);
}
Also used : FactDefinition(pcgen.cdom.content.fact.FactDefinition) ConsolidatedListCommitStrategy(pcgen.rules.context.ConsolidatedListCommitStrategy) RuntimeReferenceContext(pcgen.rules.context.RuntimeReferenceContext) URI(java.net.URI) RuntimeLoadContext(pcgen.rules.context.RuntimeLoadContext)

Example 13 with RuntimeReferenceContext

use of pcgen.rules.context.RuntimeReferenceContext in project pcgen by PCGen.

the class AbilityListTokenTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    context = new RuntimeLoadContext(new RuntimeReferenceContext(), new ConsolidatedListCommitStrategy());
    context.getReferenceContext().importObject(AbilityCategory.FEAT);
}
Also used : ConsolidatedListCommitStrategy(pcgen.rules.context.ConsolidatedListCommitStrategy) RuntimeReferenceContext(pcgen.rules.context.RuntimeReferenceContext) RuntimeLoadContext(pcgen.rules.context.RuntimeLoadContext)

Example 14 with RuntimeReferenceContext

use of pcgen.rules.context.RuntimeReferenceContext in project pcgen by PCGen.

the class AddedBonusFacetTest method setUp.

@Override
public void setUp() throws Exception {
    super.setUp();
    context = new RuntimeLoadContext(new RuntimeReferenceContext(), new ConsolidatedListCommitStrategy());
    addBonus(Combat.class);
}
Also used : ConsolidatedListCommitStrategy(pcgen.rules.context.ConsolidatedListCommitStrategy) RuntimeReferenceContext(pcgen.rules.context.RuntimeReferenceContext) RuntimeLoadContext(pcgen.rules.context.RuntimeLoadContext)

Example 15 with RuntimeReferenceContext

use of pcgen.rules.context.RuntimeReferenceContext in project pcgen by PCGen.

the class AbstractFormulaTestCase method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    context = new RuntimeLoadContext(new RuntimeReferenceContext(), new ConsolidatedListCommitStrategy());
    setup = context.getVariableContext().getFormulaSetup();
    setup.getSolverFactory().addSolverFormat(Number.class, getDMod(0));
    setup.getSolverFactory().addSolverFormat(String.class, getDMod(""));
    localSetup = new IndividualSetup(setup, "Global", new MonitorableVariableStore());
}
Also used : IndividualSetup(pcgen.base.solver.IndividualSetup) ConsolidatedListCommitStrategy(pcgen.rules.context.ConsolidatedListCommitStrategy) RuntimeReferenceContext(pcgen.rules.context.RuntimeReferenceContext) MonitorableVariableStore(pcgen.cdom.formula.MonitorableVariableStore) RuntimeLoadContext(pcgen.rules.context.RuntimeLoadContext)

Aggregations

ConsolidatedListCommitStrategy (pcgen.rules.context.ConsolidatedListCommitStrategy)23 RuntimeLoadContext (pcgen.rules.context.RuntimeLoadContext)23 RuntimeReferenceContext (pcgen.rules.context.RuntimeReferenceContext)23 URI (java.net.URI)14 FactDefinition (pcgen.cdom.content.fact.FactDefinition)8 Before (org.junit.Before)4 Test (org.junit.Test)2 FormulaSemantics (pcgen.base.formula.base.FormulaSemantics)2 LegalScope (pcgen.base.formula.base.LegalScope)2 ScopeInstance (pcgen.base.formula.base.ScopeInstance)2 VariableID (pcgen.base.formula.base.VariableID)2 VariableLibrary (pcgen.base.formula.base.VariableLibrary)2 SimpleNode (pcgen.base.formula.parse.SimpleNode)2 ReconstructionVisitor (pcgen.base.formula.visitor.ReconstructionVisitor)2 SemanticsVisitor (pcgen.base.formula.visitor.SemanticsVisitor)2 UserFunction (pcgen.cdom.content.UserFunction)2 Equipment (pcgen.core.Equipment)2 LoadContext (pcgen.rules.context.LoadContext)2 IndividualSetup (pcgen.base.solver.IndividualSetup)1 CDOMObject (pcgen.cdom.base.CDOMObject)1