Search in sources :

Example 6 with FactDefinition

use of pcgen.cdom.content.fact.FactDefinition in project pcgen by PCGen.

the class FactIntegrationTest method setUp.

@Override
public void setUp() throws PersistenceLayerException, URISyntaxException {
    TokenRegistration.clearTokens();
    super.setUp();
    cd = new FactDefinition();
    cd.setDisplayName(PROP_1);
    cd.setFormatManager(STRING_MGR);
    cd.setName(PROP_1);
    cd.setFactName(PROP_1);
    cd.setUsableLocation(PCTemplate.class);
    cd.setVisibility(Visibility.DEFAULT);
    primaryContext.getReferenceContext().importObject(cd);
    SourceFileLoader.processFactDefinitions(primaryContext);
    secondaryContext.getReferenceContext().importObject(cd);
    SourceFileLoader.processFactDefinitions(secondaryContext);
}
Also used : FactDefinition(pcgen.cdom.content.fact.FactDefinition)

Example 7 with FactDefinition

use of pcgen.cdom.content.fact.FactDefinition in project pcgen by PCGen.

the class BuildUtilities method createFact.

public static FactDefinition<?, String> createFact(LoadContext context, String factname, Class<? extends Loadable> cls) {
    FactDefinition<?, String> fd = new FactDefinition<>();
    fd.setUsableLocation(cls);
    fd.setName("*" + factname);
    fd.setFactName(factname);
    fd.setFormatManager(new StringManager());
    context.getReferenceContext().importObject(fd);
    return fd;
}
Also used : FactDefinition(pcgen.cdom.content.fact.FactDefinition) StringManager(pcgen.base.format.StringManager)

Example 8 with FactDefinition

use of pcgen.cdom.content.fact.FactDefinition in project pcgen by PCGen.

the class FactLstTest method setUp.

@Override
public void setUp() throws PersistenceLayerException, URISyntaxException {
    TokenRegistration.clearTokens();
    super.setUp();
    FactDefinition fd = new FactDefinition();
    fd.setName("DOMAIN.Possibility");
    fd.setFactName("Possibility");
    fd.setUsableLocation(Domain.class);
    fd.setFormatManager(new StringManager());
    fd.setVisibility(Visibility.HIDDEN);
    primaryContext.getReferenceContext().importObject(fd);
    secondaryContext.getReferenceContext().importObject(fd);
    SourceFileLoader.processFactDefinitions(primaryContext);
    SourceFileLoader.processFactDefinitions(secondaryContext);
}
Also used : FactDefinition(pcgen.cdom.content.fact.FactDefinition) StringManager(pcgen.base.format.StringManager)

Example 9 with FactDefinition

use of pcgen.cdom.content.fact.FactDefinition in project pcgen by PCGen.

the class DataTypeTokenTest method resetContext.

protected void resetContext() {
    URI testURI = testCampaign.getURI();
    context = new RuntimeLoadContext(new RuntimeReferenceContext(), new ConsolidatedListCommitStrategy());
    context.setSourceURI(testURI);
    context.setExtractURI(testURI);
    cd = new FactDefinition();
}
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 10 with FactDefinition

use of pcgen.cdom.content.fact.FactDefinition in project pcgen by PCGen.

the class ExplanationTokenTest method resetContext.

protected void resetContext() {
    URI testURI = testCampaign.getURI();
    context = new RuntimeLoadContext(new RuntimeReferenceContext(), new ConsolidatedListCommitStrategy());
    context.setSourceURI(testURI);
    context.setExtractURI(testURI);
    cd = new FactDefinition();
}
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)

Aggregations

FactDefinition (pcgen.cdom.content.fact.FactDefinition)12 URI (java.net.URI)8 ConsolidatedListCommitStrategy (pcgen.rules.context.ConsolidatedListCommitStrategy)8 RuntimeLoadContext (pcgen.rules.context.RuntimeLoadContext)8 RuntimeReferenceContext (pcgen.rules.context.RuntimeReferenceContext)8 StringManager (pcgen.base.format.StringManager)2 FactSetDefinition (pcgen.cdom.content.factset.FactSetDefinition)1 LoadContext (pcgen.rules.context.LoadContext)1 Visibility (pcgen.util.enumeration.Visibility)1