Search in sources :

Example 6 with XPTable

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);
    }
}
Also used : GameMode(pcgen.core.GameMode) XPTable(pcgen.core.XPTable) LevelInfo(pcgen.core.LevelInfo) PCLevelInfo(pcgen.core.pclevelinfo.PCLevelInfo)

Example 7 with XPTable

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;
}
Also used : XPTable(pcgen.core.XPTable) LevelInfo(pcgen.core.LevelInfo)

Example 8 with XPTable

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));
}
Also used : XPTable(pcgen.core.XPTable) CharID(pcgen.cdom.enumeration.CharID) AbstractItemFacetTest(pcgen.cdom.testsupport.AbstractItemFacetTest) Test(org.junit.Test)

Example 9 with XPTable

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);
}
Also used : XPTable(pcgen.core.XPTable) LevelInfo(pcgen.core.LevelInfo) CharID(pcgen.cdom.enumeration.CharID) AbstractItemFacetTest(pcgen.cdom.testsupport.AbstractItemFacetTest) Test(org.junit.Test)

Example 10 with XPTable

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;
}
Also used : XPTable(pcgen.core.XPTable)

Aggregations

XPTable (pcgen.core.XPTable)10 Test (org.junit.Test)6 CharID (pcgen.cdom.enumeration.CharID)6 AbstractItemFacetTest (pcgen.cdom.testsupport.AbstractItemFacetTest)6 LevelInfo (pcgen.core.LevelInfo)5 GameMode (pcgen.core.GameMode)1 PCLevelInfo (pcgen.core.pclevelinfo.PCLevelInfo)1