Search in sources :

Example 1 with MockUIDelegate

use of pcgen.gui2.facade.MockUIDelegate in project pcgen by PCGen.

the class DomainCcSkillTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    lscFacet = FacetLibrary.getFacet(LocalSkillCostFacet.class);
    lascFacet = FacetLibrary.getFacet(LocalAddedSkillCostFacet.class);
    sk = context.getReferenceContext().constructCDOMObject(Skill.class, "MySkill");
    dragon = context.getReferenceContext().constructCDOMObject(PCClass.class, "Dragon");
    dragon.addToListFor(ListKey.TYPE, Type.MONSTER);
    ChooserFactory.setDelegate(new MockUIDelegate());
}
Also used : Skill(pcgen.core.Skill) LocalAddedSkillCostFacet(pcgen.cdom.facet.input.LocalAddedSkillCostFacet) MockUIDelegate(pcgen.gui2.facade.MockUIDelegate) LocalSkillCostFacet(pcgen.cdom.facet.analysis.LocalSkillCostFacet) PCClass(pcgen.core.PCClass)

Example 2 with MockUIDelegate

use of pcgen.gui2.facade.MockUIDelegate in project pcgen by PCGen.

the class DomainCSkillTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    lscFacet = FacetLibrary.getFacet(LocalSkillCostFacet.class);
    lascFacet = FacetLibrary.getFacet(LocalAddedSkillCostFacet.class);
    sk = context.getReferenceContext().constructCDOMObject(Skill.class, "MySkill");
    dragon = context.getReferenceContext().constructCDOMObject(PCClass.class, "Dragon");
    dragon.addToListFor(ListKey.TYPE, Type.MONSTER);
    ChooserFactory.setDelegate(new MockUIDelegate());
}
Also used : Skill(pcgen.core.Skill) LocalAddedSkillCostFacet(pcgen.cdom.facet.input.LocalAddedSkillCostFacet) MockUIDelegate(pcgen.gui2.facade.MockUIDelegate) LocalSkillCostFacet(pcgen.cdom.facet.analysis.LocalSkillCostFacet) PCClass(pcgen.core.PCClass)

Example 3 with MockUIDelegate

use of pcgen.gui2.facade.MockUIDelegate in project pcgen by PCGen.

the class AbstractSaveRestoreTest method setUpContext.

protected void setUpContext() throws PersistenceLayerException {
    ChooserFactory.pushChooserClassname(RandomChooser.class.getName());
    TokenRegistration.clearTokens();
    TokenRegistration.register(AUTO_LANG_TOKEN);
    TokenRegistration.register(ABILITY_VISIBLE_TOKEN);
    TokenRegistration.register(AUTO_TOKEN);
    TokenRegistration.register(CHOOSE_TOKEN);
    TokenRegistration.register(CHOOSE_LANG_TOKEN);
    TokenRegistration.register(ABILITY_MULT_TOKEN);
    TokenRegistration.register(EQUIP_TYPE_TOKEN);
    TokenRegistration.register(EQUIP_PROFICIENCY_TOKEN);
    TokenRegistration.register(LANGBONUS_PRIM);
    TokenRegistration.register(PC_QUAL);
    TokenRegistration.register(Feat.class);
    directAbilityFacet = FacetLibrary.getFacet(DirectAbilityFacet.class);
    activeEqModFacet = FacetLibrary.getFacet(ActiveEqModFacet.class);
    alignmentFacet = FacetLibrary.getFacet(AlignmentFacet.class);
    bioSetFacet = FacetLibrary.getFacet(BioSetFacet.class);
    checkFacet = FacetLibrary.getFacet(CheckFacet.class);
    classFacet = FacetLibrary.getFacet(ClassFacet.class);
    classLevelFacet = FacetLibrary.getFacet(ClassLevelFacet.class);
    companionModFacet = FacetLibrary.getFacet(CompanionModFacet.class);
    deityFacet = FacetLibrary.getFacet(DeityFacet.class);
    domainFacet = FacetLibrary.getFacet(DomainFacet.class);
    expandedCampaignFacet = FacetLibrary.getFacet(ExpandedCampaignFacet.class);
    languageFacet = FacetLibrary.getFacet(LanguageFacet.class);
    raceFacet = FacetLibrary.getFacet(RaceSelectionFacet.class);
    sizeFacet = FacetLibrary.getFacet(SizeFacet.class);
    skillFacet = FacetLibrary.getFacet(SkillFacet.class);
    statFacet = FacetLibrary.getFacet(StatFacet.class);
    templateFacet = FacetLibrary.getFacet(TemplateSelectionFacet.class);
    templateConsolidationFacet = FacetLibrary.getFacet(TemplateFacet.class);
    weaponProfFacet = FacetLibrary.getFacet(WeaponProfFacet.class);
    Globals.createEmptyRace();
    Globals.setUseGUI(false);
    Globals.emptyLists();
    GameMode gamemode = SettingsHandler.getGame();
    gamemode.clearLoadContext();
    str = BuildUtilities.createStat("Strength", "STR");
    str.put(VariableKey.getConstant("LOADSCORE"), FormulaFactory.getFormulaFor("STRSCORE"));
    str.put(VariableKey.getConstant("OFFHANDLIGHTBONUS"), FormulaFactory.getFormulaFor(2));
    dex = BuildUtilities.createStat("Dexterity", "DEX");
    con = BuildUtilities.createStat("Constitution", "CON");
    intel = BuildUtilities.createStat("Intelligence", "INT");
    wis = BuildUtilities.createStat("Wisdom", "WIS");
    cha = BuildUtilities.createStat("Charisma", "CHA");
    AbstractReferenceContext ref = Globals.getContext().getReferenceContext();
    lg = BuildUtilities.createAlignment("Lawful Good", "LG");
    ref.importObject(lg);
    ln = BuildUtilities.createAlignment("Lawful Neutral", "LN");
    ref.importObject(ln);
    le = BuildUtilities.createAlignment("Lawful Evil", "LE");
    ref.importObject(le);
    ng = BuildUtilities.createAlignment("Neutral Good", "NG");
    ref.importObject(ng);
    tn = BuildUtilities.createAlignment("True Neutral", "TN");
    ref.importObject(tn);
    ne = BuildUtilities.createAlignment("Neutral Evil", "NE");
    ref.importObject(ne);
    cg = BuildUtilities.createAlignment("Chaotic Good", "CG");
    ref.importObject(cg);
    cn = BuildUtilities.createAlignment("Chaotic Neutral", "CN");
    ref.importObject(cn);
    ce = BuildUtilities.createAlignment("Chaotic Evil", "CE");
    ref.importObject(ce);
    ref.importObject(BuildUtilities.createAlignment("None", "NONE"));
    ref.importObject(BuildUtilities.createAlignment("Deity's", "Deity"));
    ref.importObject(str);
    ref.importObject(dex);
    ref.importObject(con);
    ref.importObject(intel);
    ref.importObject(wis);
    ref.importObject(cha);
    fine = BuildUtilities.createSize("Fine", 0);
    diminutive = BuildUtilities.createSize("Diminutive", 1);
    tiny = BuildUtilities.createSize("Tiny", 2);
    small = BuildUtilities.createSize("Small", 3);
    medium = BuildUtilities.createSize("Medium", 4);
    medium.put(ObjectKey.IS_DEFAULT_SIZE, true);
    large = BuildUtilities.createSize("Large", 5);
    huge = BuildUtilities.createSize("Huge", 6);
    gargantuan = BuildUtilities.createSize("Gargantuan", 7);
    colossal = BuildUtilities.createSize("Colossal", 8);
    context = Globals.getContext();
    create(Language.class, "Common");
    human = create(Race.class, "Human");
    BuildUtilities.createFact(context, "ClassType", PCClass.class);
    FactDefinition<?, String> fd = BuildUtilities.createFact(context, "SpellType", PCClass.class);
    fd.setSelectable(true);
    context.getReferenceContext().importObject(AbilityCategory.FEAT);
    SourceFileLoader.createLangBonusObject(Globals.getContext());
    ChooserFactory.setDelegate(new MockUIDelegate());
}
Also used : AbstractReferenceContext(pcgen.rules.context.AbstractReferenceContext) TemplateFacet(pcgen.cdom.facet.model.TemplateFacet) MockUIDelegate(pcgen.gui2.facade.MockUIDelegate) RandomChooser(pcgen.util.chooser.RandomChooser) CompanionModFacet(pcgen.cdom.facet.model.CompanionModFacet) DomainFacet(pcgen.cdom.facet.model.DomainFacet) StatFacet(pcgen.cdom.facet.model.StatFacet) AlignmentFacet(pcgen.cdom.facet.model.AlignmentFacet) Race(pcgen.core.Race) ActiveEqModFacet(pcgen.cdom.facet.model.ActiveEqModFacet) TemplateSelectionFacet(pcgen.cdom.facet.TemplateSelectionFacet) ClassFacet(pcgen.cdom.facet.model.ClassFacet) ClassLevelFacet(pcgen.cdom.facet.model.ClassLevelFacet) CheckFacet(pcgen.cdom.facet.model.CheckFacet) BioSetFacet(pcgen.cdom.facet.model.BioSetFacet) RaceSelectionFacet(pcgen.cdom.facet.RaceSelectionFacet) GameMode(pcgen.core.GameMode) SizeFacet(pcgen.cdom.facet.model.SizeFacet) ExpandedCampaignFacet(pcgen.cdom.facet.model.ExpandedCampaignFacet) DeityFacet(pcgen.cdom.facet.model.DeityFacet) WeaponProfFacet(pcgen.cdom.facet.WeaponProfFacet) DirectAbilityFacet(pcgen.cdom.facet.DirectAbilityFacet) LanguageFacet(pcgen.cdom.facet.model.LanguageFacet) SkillFacet(pcgen.cdom.facet.model.SkillFacet)

Example 4 with MockUIDelegate

use of pcgen.gui2.facade.MockUIDelegate in project pcgen by PCGen.

the class SpellClassesTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    sp = context.getReferenceContext().constructCDOMObject(Spell.class, "MySpell");
    dragon = context.getReferenceContext().constructCDOMObject(PCClass.class, "Dragon");
    dragon.addToListFor(ListKey.TYPE, Type.MONSTER);
    ChooserFactory.setDelegate(new MockUIDelegate());
}
Also used : MockUIDelegate(pcgen.gui2.facade.MockUIDelegate) PCClass(pcgen.core.PCClass) Spell(pcgen.core.spell.Spell)

Example 5 with MockUIDelegate

use of pcgen.gui2.facade.MockUIDelegate in project pcgen by PCGen.

the class PCClassLevelCSkillTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    lscFacet = FacetLibrary.getFacet(LocalSkillCostFacet.class);
    sk = context.getReferenceContext().constructCDOMObject(Skill.class, "MySkill");
    dragon = context.getReferenceContext().constructCDOMObject(PCClass.class, "Dragon");
    dragon.addToListFor(ListKey.TYPE, Type.MONSTER);
    ChooserFactory.setDelegate(new MockUIDelegate());
}
Also used : Skill(pcgen.core.Skill) MockUIDelegate(pcgen.gui2.facade.MockUIDelegate) LocalSkillCostFacet(pcgen.cdom.facet.analysis.LocalSkillCostFacet) PCClass(pcgen.core.PCClass)

Aggregations

MockUIDelegate (pcgen.gui2.facade.MockUIDelegate)14 PCClass (pcgen.core.PCClass)9 Skill (pcgen.core.Skill)7 LocalSkillCostFacet (pcgen.cdom.facet.analysis.LocalSkillCostFacet)4 FavoredClassFacet (pcgen.cdom.facet.analysis.FavoredClassFacet)2 ListSkillCostFacet (pcgen.cdom.facet.analysis.ListSkillCostFacet)2 LocalAddedSkillCostFacet (pcgen.cdom.facet.input.LocalAddedSkillCostFacet)2 Spell (pcgen.core.spell.Spell)2 ArrayList (java.util.ArrayList)1 LogRecord (java.util.logging.LogRecord)1 Test (org.junit.Test)1 DirectAbilityFacet (pcgen.cdom.facet.DirectAbilityFacet)1 RaceSelectionFacet (pcgen.cdom.facet.RaceSelectionFacet)1 TemplateSelectionFacet (pcgen.cdom.facet.TemplateSelectionFacet)1 WeaponProfFacet (pcgen.cdom.facet.WeaponProfFacet)1 MonsterCSkillFacet (pcgen.cdom.facet.input.MonsterCSkillFacet)1 ActiveEqModFacet (pcgen.cdom.facet.model.ActiveEqModFacet)1 AlignmentFacet (pcgen.cdom.facet.model.AlignmentFacet)1 BioSetFacet (pcgen.cdom.facet.model.BioSetFacet)1 CheckFacet (pcgen.cdom.facet.model.CheckFacet)1