Search in sources :

Example 1 with CDOMWrapperInfoFacet

use of pcgen.cdom.facet.CDOMWrapperInfoFacet in project pcgen by PCGen.

the class FreeMarkerTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    if (!classSetUpRun) {
        classSetUp();
        classSetUpRun = true;
    }
    CDOMWrapperInfoFacet wiFacet = FacetLibrary.getFacet(CDOMWrapperInfoFacet.class);
    wiFacet.initialize(dsid);
}
Also used : CDOMWrapperInfoFacet(pcgen.cdom.facet.CDOMWrapperInfoFacet)

Example 2 with CDOMWrapperInfoFacet

use of pcgen.cdom.facet.CDOMWrapperInfoFacet in project pcgen by PCGen.

the class FactKeyActorTest method testListKeyActorMissingSafe.

public void testListKeyActorMissingSafe() {
    NumberManager mgr = new NumberManager();
    FactKey<Number> fk = FactKey.getConstant("cost", mgr);
    FactKeyActor<?> ika = new FactKeyActor<>(fk);
    CDOMWrapperInfoFacet wiFacet = FacetLibrary.getFacet(CDOMWrapperInfoFacet.class);
    wiFacet.set(dsid, Deity.class, "cost", ika);
    processThroughFreeMarker("${deity.cost!}", "");
}
Also used : CDOMWrapperInfoFacet(pcgen.cdom.facet.CDOMWrapperInfoFacet) NumberManager(pcgen.base.format.NumberManager)

Example 3 with CDOMWrapperInfoFacet

use of pcgen.cdom.facet.CDOMWrapperInfoFacet in project pcgen by PCGen.

the class FactKeyActorTest method testFactKeyActor.

public void testFactKeyActor() {
    Deity d = new Deity();
    d.setName("Bob");
    Integer expectedResult = 475;
    df.set(id, d);
    NumberManager mgr = new NumberManager();
    FactKey<Number> fk = FactKey.getConstant("cost", mgr);
    d.put(fk, new BasicIndirect<>(mgr, expectedResult));
    FactKeyActor<?> ika = new FactKeyActor<>(fk);
    CDOMWrapperInfoFacet wiFacet = FacetLibrary.getFacet(CDOMWrapperInfoFacet.class);
    wiFacet.set(dsid, d.getClass(), "cost", ika);
    processThroughFreeMarker("${deity.cost}", expectedResult.toString());
}
Also used : Deity(pcgen.core.Deity) CDOMWrapperInfoFacet(pcgen.cdom.facet.CDOMWrapperInfoFacet) NumberManager(pcgen.base.format.NumberManager)

Example 4 with CDOMWrapperInfoFacet

use of pcgen.cdom.facet.CDOMWrapperInfoFacet in project pcgen by PCGen.

the class FactSetDefinition method activateOutput.

/**
	 * @see pcgen.cdom.content.ContentDefinition#activateOutput(DataSetID)
	 */
@Override
protected void activateOutput(DataSetID dsID) {
    FactSetKeyActor<F> fca = new FactSetKeyActor<>(getFactSetKey());
    CDOMWrapperInfoFacet wiFacet = FacetLibrary.getFacet(CDOMWrapperInfoFacet.class);
    if (!wiFacet.set(dsID, getUsableLocation(), factSetName.toLowerCase(), fca)) {
        Logging.errorPrint(getUsableLocation().getSimpleName() + " output " + factSetName.toLowerCase() + " already exists, ignoring Visibility to EXPORT for FACTSET: " + factSetName);
    }
}
Also used : CDOMWrapperInfoFacet(pcgen.cdom.facet.CDOMWrapperInfoFacet) FactSetKeyActor(pcgen.output.actor.FactSetKeyActor)

Example 5 with CDOMWrapperInfoFacet

use of pcgen.cdom.facet.CDOMWrapperInfoFacet in project pcgen by PCGen.

the class FactDefinition method activateOutput.

/**
	 * @see pcgen.cdom.content.ContentDefinition#activateOutput(DataSetID)
	 */
@Override
protected void activateOutput(DataSetID dsID) {
    FactKeyActor<?> fca = new FactKeyActor<>(getFactKey());
    CDOMWrapperInfoFacet wiFacet = FacetLibrary.getFacet(CDOMWrapperInfoFacet.class);
    if (!wiFacet.set(dsID, getUsableLocation(), factName.toLowerCase(), fca)) {
        Logging.errorPrint(getUsableLocation().getSimpleName() + " output " + factName.toLowerCase() + " already exists, ignoring Visibility to EXPORT for FACT: " + factName);
    }
}
Also used : CDOMWrapperInfoFacet(pcgen.cdom.facet.CDOMWrapperInfoFacet) FactKeyActor(pcgen.output.actor.FactKeyActor)

Aggregations

CDOMWrapperInfoFacet (pcgen.cdom.facet.CDOMWrapperInfoFacet)5 NumberManager (pcgen.base.format.NumberManager)2 Deity (pcgen.core.Deity)1 FactKeyActor (pcgen.output.actor.FactKeyActor)1 FactSetKeyActor (pcgen.output.actor.FactSetKeyActor)1