use of pcgen.core.XPTable in project pcgen by PCGen.
the class CharacterLevelsFacadeImplTest method setGameSkillRankData.
private void setGameSkillRankData(boolean crossClassCostTwo) {
GameMode game = SettingsHandler.getGame();
final XPTable xpTable = game.getLevelInfo(game.getDefaultXPTableName());
LevelInfo levelInfo = xpTable.getLevelInfo(1);
levelInfo.setLevelString("LEVEL");
if (crossClassCostTwo) {
levelInfo.setMaxClassSkillString("LEVEL+3");
levelInfo.setMaxCrossClassSkillString("(LEVEL+3)/2");
game.setSkillCost_CrossClass(2);
} else {
levelInfo.setMaxClassSkillString("LEVEL");
levelInfo.setMaxCrossClassSkillString("LEVEL");
game.setSkillCost_CrossClass(1);
}
}
use of pcgen.core.XPTable in project pcgen by PCGen.
the class XPTableFacet method getLevelInfo.
/**
* Returns Level information for the given Level
*
* @param level
* the level for which Level Info should be returned
* @return The LevelInfo for the given level
*/
public LevelInfo getLevelInfo(CharID id, int level) {
if (level < 1) {
return null;
}
XPTable table = get(id);
if (table == null) {
return null;
}
LevelInfo lInfo = table.getLevelInfo(String.valueOf(level));
if (lInfo == null) {
lInfo = table.getLevelInfo("LEVEL");
}
return lInfo;
}
use of pcgen.core.XPTable in project pcgen by PCGen.
the class XPTableFacetTest method testGetLevelInfoNegLevel.
@Test
public void testGetLevelInfoNegLevel() {
XPTable t1 = getItem();
CharID id = getCharID();
facet.set(id, t1);
assertNull(facet.getLevelInfo(id, -1));
}
use of pcgen.core.XPTable in project pcgen by PCGen.
the class XPTableFacetTest method testGetLevelInfo.
@Test
public void testGetLevelInfo() {
XPTable t1 = getItem();
LevelInfo li = new LevelInfo();
t1.addLevelInfo("1", li);
CharID id = getCharID();
facet.set(id, t1);
LevelInfo xpt = facet.getLevelInfo(id, 1);
assertNotNull(xpt);
assertSame(li, xpt);
}
use of pcgen.core.XPTable in project pcgen by PCGen.
the class XPTableFacetTest method getItem.
@Override
protected XPTable getItem() {
XPTable xpt = new XPTable();
xpt.setName("XPTable" + n++);
return xpt;
}
Aggregations