Search in sources :

Example 1 with LevelFacet

use of pcgen.cdom.facet.analysis.LevelFacet in project pcgen by PCGen.

the class FacetInitialization method doInitialization.

private static void doInitialization() {
    doOtherInitialization();
    doBridges();
    TemplateFacet templateFacet = FacetLibrary.getFacet(TemplateFacet.class);
    ConditionalTemplateFacet conditionalTemplateFacet = FacetLibrary.getFacet(ConditionalTemplateFacet.class);
    RaceFacet raceFacet = FacetLibrary.getFacet(RaceFacet.class);
    ClassFacet classFacet = FacetLibrary.getFacet(ClassFacet.class);
    ClassLevelFacet classLevelFacet = FacetLibrary.getFacet(ClassLevelFacet.class);
    ExpandedCampaignFacet expandedCampaignFacet = FacetLibrary.getFacet(ExpandedCampaignFacet.class);
    EquipmentFacet equipmentFacet = FacetLibrary.getFacet(EquipmentFacet.class);
    EquippedEquipmentFacet equippedFacet = FacetLibrary.getFacet(EquippedEquipmentFacet.class);
    NaturalEquipmentFacet naturalEquipmentFacet = FacetLibrary.getFacet(NaturalEquipmentFacet.class);
    SourcedEquipmentFacet activeEquipmentFacet = FacetLibrary.getFacet(SourcedEquipmentFacet.class);
    ActiveEqModFacet activeEqModFacet = FacetLibrary.getFacet(ActiveEqModFacet.class);
    GlobalModifierFacet globalModifierFacet = FacetLibrary.getFacet(GlobalModifierFacet.class);
    AlignmentFacet alignmentFacet = FacetLibrary.getFacet(AlignmentFacet.class);
    BioSetFacet bioSetFacet = FacetLibrary.getFacet(BioSetFacet.class);
    BioSetTrackingFacet bioSetTrackingFacet = FacetLibrary.getFacet(BioSetTrackingFacet.class);
    CheckFacet checkFacet = FacetLibrary.getFacet(CheckFacet.class);
    DynamicFacet dynamicFacet = FacetLibrary.getFacet(DynamicFacet.class);
    DynamicConsolidationFacet dynamicConsolidationFacet = FacetLibrary.getFacet(DynamicConsolidationFacet.class);
    VarScopedFacet varScopedFacet = FacetLibrary.getFacet(VarScopedFacet.class);
    AutoLanguageFacet autoLangFacet = FacetLibrary.getFacet(AutoLanguageFacet.class);
    WeaponProfFacet weaponProfFacet = FacetLibrary.getFacet(WeaponProfFacet.class);
    LevelFacet levelFacet = FacetLibrary.getFacet(LevelFacet.class);
    SizeFacet sizeFacet = FacetLibrary.getFacet(SizeFacet.class);
    BonusChangeFacet bonusChangeFacet = FacetLibrary.getFacet(BonusChangeFacet.class);
    DeityFacet deityFacet = FacetLibrary.getFacet(DeityFacet.class);
    DomainFacet domainFacet = FacetLibrary.getFacet(DomainFacet.class);
    CompanionModFacet companionModFacet = FacetLibrary.getFacet(CompanionModFacet.class);
    StatFacet statFacet = FacetLibrary.getFacet(StatFacet.class);
    SkillFacet skillFacet = FacetLibrary.getFacet(SkillFacet.class);
    NaturalWeaponProfFacet nwpFacet = FacetLibrary.getFacet(NaturalWeaponProfFacet.class);
    UserEquipmentFacet userEquipmentFacet = FacetLibrary.getFacet(UserEquipmentFacet.class);
    NaturalWeaponFacet naturalWeaponFacet = FacetLibrary.getFacet(NaturalWeaponFacet.class);
    EquipSetFacet equipSetFacet = FacetLibrary.getFacet(EquipSetFacet.class);
    CDOMObjectConsolidationFacet cdomObjectFacet = FacetLibrary.getFacet(CDOMObjectConsolidationFacet.class);
    CDOMObjectSourceFacet cdomSourceFacet = FacetLibrary.getFacet(CDOMObjectSourceFacet.class);
    CharacterConsolidationFacet charObjectFacet = FacetLibrary.getFacet(CharacterConsolidationFacet.class);
    EquipmentConsolidationFacet eqObjectFacet = FacetLibrary.getFacet(EquipmentConsolidationFacet.class);
    GrantedAbilityFacet grantedAbilityFacet = FacetLibrary.getFacet(GrantedAbilityFacet.class);
    DirectAbilityFacet directAbilityFacet = FacetLibrary.getFacet(DirectAbilityFacet.class);
    DirectAbilityInputFacet directAbilityInputFacet = FacetLibrary.getFacet(DirectAbilityInputFacet.class);
    ConditionallyGrantedAbilityFacet cabFacet = FacetLibrary.getFacet(ConditionallyGrantedAbilityFacet.class);
    SimpleAbilityFacet simpleAbilityFacet = FacetLibrary.getFacet(SimpleAbilityFacet.class);
    AbilitySelectionApplication abilitySelectionApplication = FacetLibrary.getFacet(AbilitySelectionApplication.class);
    equipmentFacet.addDataFacetChangeListener(naturalEquipmentFacet);
    equippedFacet.addDataFacetChangeListener(activeEquipmentFacet);
    naturalEquipmentFacet.addDataFacetChangeListener(activeEquipmentFacet);
    activeEquipmentFacet.addDataFacetChangeListener(activeEqModFacet);
    nwpFacet.addDataFacetChangeListener(weaponProfFacet);
    dynamicFacet.addScopeFacetChangeListener(dynamicConsolidationFacet);
    charObjectFacet.addDataFacetChangeListener(naturalWeaponFacet);
    naturalWeaponFacet.addDataFacetChangeListener(equipmentFacet);
    naturalWeaponFacet.addDataFacetChangeListener(userEquipmentFacet);
    naturalWeaponFacet.addDataFacetChangeListener(equipSetFacet);
    classFacet.addLevelChangeListener(levelFacet);
    levelFacet.addLevelChangeListener(conditionalTemplateFacet);
    levelFacet.addLevelChangeListener(sizeFacet);
    grantedAbilityFacet.addDataFacetChangeListener(abilitySelectionApplication);
    grantedAbilityFacet.addDataFacetChangeListener(simpleAbilityFacet);
    directAbilityFacet.addDataFacetChangeListener(grantedAbilityFacet);
    directAbilityInputFacet.addDataFacetChangeListener(grantedAbilityFacet);
    cabFacet.addDataFacetChangeListener(grantedAbilityFacet);
    raceFacet.addDataFacetChangeListener(bioSetTrackingFacet);
    bonusChangeFacet.addBonusChangeListener(sizeFacet, "SIZEMOD", "NUMBER");
    //model done
    expandedCampaignFacet.addDataFacetChangeListener(charObjectFacet);
    //model done
    globalModifierFacet.addDataFacetChangeListener(charObjectFacet);
    //model done
    alignmentFacet.addDataFacetChangeListener(charObjectFacet);
    //model done
    bioSetFacet.addDataFacetChangeListener(charObjectFacet);
    //model done
    checkFacet.addDataFacetChangeListener(charObjectFacet);
    //model done
    classFacet.addDataFacetChangeListener(charObjectFacet);
    //model done
    deityFacet.addDataFacetChangeListener(charObjectFacet);
    //model done
    domainFacet.addDataFacetChangeListener(charObjectFacet);
    //model done
    raceFacet.addDataFacetChangeListener(charObjectFacet);
    sizeFacet.addDataFacetChangeListener(charObjectFacet);
    //model done
    skillFacet.addDataFacetChangeListener(charObjectFacet);
    //model done
    statFacet.addDataFacetChangeListener(charObjectFacet);
    //model done
    templateFacet.addDataFacetChangeListener(charObjectFacet);
    // weaponProfList is still just a list of Strings
    // results.addAll(getWeaponProfList());
    //model done
    classLevelFacet.addDataFacetChangeListener(charObjectFacet);
    //model done
    simpleAbilityFacet.addDataFacetChangeListener(charObjectFacet);
    //model done
    companionModFacet.addDataFacetChangeListener(charObjectFacet);
    activeEquipmentFacet.addDataFacetChangeListener(eqObjectFacet);
    activeEqModFacet.addDataFacetChangeListener(eqObjectFacet);
    eqObjectFacet.addDataFacetChangeListener(cdomObjectFacet);
    charObjectFacet.addDataFacetChangeListener(cdomObjectFacet);
    cdomObjectFacet.addDataFacetChangeListener(nwpFacet);
    cdomSourceFacet.addDataFacetChangeListener(autoLangFacet);
    charObjectFacet.addDataFacetChangeListener(varScopedFacet);
    //model done
    dynamicConsolidationFacet.addDataFacetChangeListener(varScopedFacet);
}
Also used : DynamicConsolidationFacet(pcgen.cdom.facet.model.DynamicConsolidationFacet) VarScopedFacet(pcgen.cdom.facet.model.VarScopedFacet) TemplateFacet(pcgen.cdom.facet.model.TemplateFacet) CompanionModFacet(pcgen.cdom.facet.model.CompanionModFacet) DomainFacet(pcgen.cdom.facet.model.DomainFacet) StatFacet(pcgen.cdom.facet.model.StatFacet) AlignmentFacet(pcgen.cdom.facet.model.AlignmentFacet) DynamicFacet(pcgen.cdom.facet.input.DynamicFacet) ActiveEqModFacet(pcgen.cdom.facet.model.ActiveEqModFacet) RaceFacet(pcgen.cdom.facet.model.RaceFacet) ClassFacet(pcgen.cdom.facet.model.ClassFacet) ClassLevelFacet(pcgen.cdom.facet.model.ClassLevelFacet) CheckFacet(pcgen.cdom.facet.model.CheckFacet) BioSetFacet(pcgen.cdom.facet.model.BioSetFacet) LevelFacet(pcgen.cdom.facet.analysis.LevelFacet) ClassLevelFacet(pcgen.cdom.facet.model.ClassLevelFacet) SizeFacet(pcgen.cdom.facet.model.SizeFacet) SimpleAbilityFacet(pcgen.cdom.facet.model.SimpleAbilityFacet) ExpandedCampaignFacet(pcgen.cdom.facet.model.ExpandedCampaignFacet) DeityFacet(pcgen.cdom.facet.model.DeityFacet) MasterUsableSkillFacet(pcgen.cdom.facet.input.MasterUsableSkillFacet) SkillFacet(pcgen.cdom.facet.model.SkillFacet)

Example 2 with LevelFacet

use of pcgen.cdom.facet.analysis.LevelFacet in project pcgen by PCGen.

the class XPFacetTest method getMockFacet.

public XPFacet getMockFacet() throws SecurityException, IllegalArgumentException {
    XPFacet f = new XPFacet();
    LevelFacet fakeFacet = new LevelFacet() {

        @Override
        public int getLevelAdjustment(CharID cid) {
            return adjustment;
        }
    };
    f.setLevelFacet(fakeFacet);
    LevelTableFacet fakeTableFacet = new LevelTableFacet() {

        @Override
        public int minXPForLevel(int level, CharID cid) {
            return minXP.get(level);
        }
    };
    f.setLevelTableFacet(fakeTableFacet);
    return f;
}
Also used : LevelFacet(pcgen.cdom.facet.analysis.LevelFacet) LevelTableFacet(pcgen.cdom.facet.analysis.LevelTableFacet) CharID(pcgen.cdom.enumeration.CharID)

Example 3 with LevelFacet

use of pcgen.cdom.facet.analysis.LevelFacet in project pcgen by PCGen.

the class SizeFacetTest method getMockFacet.

public SizeFacet getMockFacet() throws SecurityException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException {
    SizeFacet f = new SizeFacet();
    Field field = SizeFacet.class.getDeclaredField("bonusCheckingFacet");
    field.setAccessible(true);
    BonusCheckingFacet fakeFacet = new BonusCheckingFacet() {

        @Override
        public double getBonus(CharID cid, String bonusType, String bonusName) {
            if ("SIZEMOD".equals(bonusType) && "NUMBER".equals(bonusName)) {
                Double d = bonusInfo.get(cid);
                return d == null ? 0 : d;
            }
            return 0;
        }
    };
    field.set(f, fakeFacet);
    field = SizeFacet.class.getDeclaredField("levelFacet");
    field.setAccessible(true);
    LevelFacet fakeLevelFacet = new LevelFacet() {

        @Override
        public int getMonsterLevelCount(CharID cid) {
            return fakeLevels;
        }
    };
    field.set(f, fakeLevelFacet);
    return f;
}
Also used : Field(java.lang.reflect.Field) BonusCheckingFacet(pcgen.cdom.facet.BonusCheckingFacet) LevelFacet(pcgen.cdom.facet.analysis.LevelFacet) CharID(pcgen.cdom.enumeration.CharID)

Aggregations

LevelFacet (pcgen.cdom.facet.analysis.LevelFacet)3 CharID (pcgen.cdom.enumeration.CharID)2 Field (java.lang.reflect.Field)1 BonusCheckingFacet (pcgen.cdom.facet.BonusCheckingFacet)1 LevelTableFacet (pcgen.cdom.facet.analysis.LevelTableFacet)1 DynamicFacet (pcgen.cdom.facet.input.DynamicFacet)1 MasterUsableSkillFacet (pcgen.cdom.facet.input.MasterUsableSkillFacet)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 ClassFacet (pcgen.cdom.facet.model.ClassFacet)1 ClassLevelFacet (pcgen.cdom.facet.model.ClassLevelFacet)1 CompanionModFacet (pcgen.cdom.facet.model.CompanionModFacet)1 DeityFacet (pcgen.cdom.facet.model.DeityFacet)1 DomainFacet (pcgen.cdom.facet.model.DomainFacet)1 DynamicConsolidationFacet (pcgen.cdom.facet.model.DynamicConsolidationFacet)1 ExpandedCampaignFacet (pcgen.cdom.facet.model.ExpandedCampaignFacet)1 RaceFacet (pcgen.cdom.facet.model.RaceFacet)1 SimpleAbilityFacet (pcgen.cdom.facet.model.SimpleAbilityFacet)1