use of pcgen.core.ChronicleEntry in project pcgen by PCGen.
the class DescriptionFacadeImpl method createChronicleEntry.
/**
* @see pcgen.core.facade.DescriptionFacade#createChronicleEntry()
*/
@Override
public ChronicleEntryFacade createChronicleEntry() {
ChronicleEntry chronicleEntry = new ChronicleEntry();
theCharacter.addChronicleEntry(chronicleEntry);
chronicleEntries.addElement(chronicleEntry);
return chronicleEntry;
}
use of pcgen.core.ChronicleEntry in project pcgen by PCGen.
the class TestHelper method buildChronicleEntry.
public static ChronicleEntry buildChronicleEntry(boolean visible, String campaign, String date, String gm, String party, String adventure, int xp, String chronicle) {
ChronicleEntry chronEntry = new ChronicleEntry();
chronEntry.setOutputEntry(visible);
chronEntry.setCampaign(campaign);
chronEntry.setDate(date);
chronEntry.setGmField(gm);
chronEntry.setParty(party);
chronEntry.setAdventure(adventure);
chronEntry.setXpField(xp);
chronEntry.setChronicle(chronicle);
return chronEntry;
}
use of pcgen.core.ChronicleEntry in project pcgen by PCGen.
the class PCGVer2Creator method appendCampaignHistoryLines.
/**
* @param buffer
*/
private void appendCampaignHistoryLines(StringBuilder buffer) {
for (ChronicleEntry ce : charDisplay.getChronicleEntries()) {
buffer.append(IOConstants.TAG_CHRONICLE_ENTRY).append(':');
buffer.append(ce.isOutputEntry() ? "Y" : "N:");
buffer.append('|');
buffer.append(IOConstants.TAG_CAMPAIGN).append(':');
buffer.append(EntityEncoder.encode(ce.getCampaign()));
buffer.append('|');
buffer.append(IOConstants.TAG_ADVENTURE).append(':');
buffer.append(EntityEncoder.encode(ce.getAdventure()));
buffer.append('|');
buffer.append(IOConstants.TAG_PARTY).append(':');
buffer.append(EntityEncoder.encode(ce.getParty()));
buffer.append('|');
buffer.append(IOConstants.TAG_DATE).append(':');
buffer.append(EntityEncoder.encode(ce.getDate()));
buffer.append('|');
buffer.append(IOConstants.TAG_EXPERIENCE).append(':');
buffer.append(ce.getXpField());
buffer.append('|');
buffer.append(IOConstants.TAG_GM).append(':');
buffer.append(EntityEncoder.encode(ce.getGmField()));
buffer.append('|');
buffer.append(IOConstants.TAG_CHRONICLE).append(':');
buffer.append(EntityEncoder.encode(ce.getChronicle()));
buffer.append(IOConstants.LINE_SEP);
}
}
use of pcgen.core.ChronicleEntry in project pcgen by PCGen.
the class ChronicleEntryFacetTest method testAddAllTwice.
@Override
public void testAddAllTwice() {
ChronicleEntry t1 = getObject();
List<ChronicleEntry> pct = new ArrayList<>();
pct.add(t1);
pct.add(t1);
getFacet().addAll(id, pct);
assertEquals(2, getFacet().getCount(id));
assertFalse(getFacet().isEmpty(id));
Collection<ChronicleEntry> setofone = getFacet().getSet(id);
assertNotNull(setofone);
assertEquals(2, setofone.size());
assertTrue(setofone.contains(t1));
assertEventCount(2, 0);
}
use of pcgen.core.ChronicleEntry in project pcgen by PCGen.
the class ChronicleEntryFacetTest method testAddSingleTwiceGet.
@Override
public void testAddSingleTwiceGet() {
ChronicleEntry t1 = getObject();
getFacet().add(id, t1);
assertEquals(1, getFacet().getCount(id));
assertFalse(getFacet().isEmpty(id));
assertNotNull(getFacet().getSet(id));
assertEquals(1, getFacet().getSet(id).size());
assertEquals(t1, getFacet().getSet(id).iterator().next());
assertEventCount(1, 0);
// Add same, now there twice (LIST not SET)
getFacet().add(id, t1);
assertEquals(2, getFacet().getCount(id));
assertFalse(getFacet().isEmpty(id));
assertNotNull(getFacet().getSet(id));
assertEquals(2, getFacet().getSet(id).size());
assertEquals(t1, getFacet().getSet(id).iterator().next());
assertEventCount(2, 0);
}
Aggregations