public CombatGenerator(IArmorClassGenerator armorClassGenerator, IHitPointsGenerator hitPointsGenerator, ISavingThrowsGenerator savingThrowsGenerator,
     IAdjustmentsSelector adjustmentsSelector, ICollectionsSelector collectionsSelector)
 {
     this.armorClassGenerator = armorClassGenerator;
     this.hitPointsGenerator = hitPointsGenerator;
     this.savingThrowsGenerator = savingThrowsGenerator;
     this.adjustmentsSelector = adjustmentsSelector;
     this.collectionsSelector = collectionsSelector;
 }
Exemple #2
0
        public void Setup()
        {
            mockAdjustmentsSelector = new Mock <IAdjustmentsSelector>();
            mockBonusSelector       = new Mock <IBonusSelector>();
            armorClassGenerator     = new ArmorClassGenerator(mockBonusSelector.Object, mockAdjustmentsSelector.Object);

            feats         = new List <Feat>();
            creatureType  = new CreatureType();
            abilities     = new Dictionary <string, Ability>();
            racialBonuses = new Dictionary <string, List <BonusSelection> >();
            equipment     = new Equipment();

            creatureType.Name = "creature type";
            abilities[AbilityConstants.Dexterity] = new Ability(AbilityConstants.Dexterity);
            abilities[AbilityConstants.Charisma]  = new Ability(AbilityConstants.Charisma);
            racialBonuses["creature"]             = new List <BonusSelection>();
            racialBonuses[creatureType.Name]      = new List <BonusSelection>();

            mockAdjustmentsSelector.Setup(s => s.SelectFrom <int>(TableNameConstants.Adjustments.SizeModifiers, "size")).Returns(0);

            mockBonusSelector.Setup(s => s.SelectFor(TableNameConstants.TypeAndAmount.ArmorClassBonuses, It.IsAny <string>())).Returns((string t, string s) => racialBonuses[s]);
        }
 public CreatureGenerator(IAlignmentGenerator alignmentGenerator,
                          ICreatureVerifier creatureVerifier,
                          ICollectionSelector collectionsSelector,
                          IAbilitiesGenerator abilitiesGenerator,
                          ISkillsGenerator skillsGenerator,
                          IFeatsGenerator featsGenerator,
                          ICreatureDataSelector creatureDataSelector,
                          IHitPointsGenerator hitPointsGenerator,
                          IArmorClassGenerator armorClassGenerator,
                          ISavesGenerator savesGenerator,
                          JustInTimeFactory justInTimeFactory,
                          IAdvancementSelector advancementSelector,
                          IAttacksGenerator attacksGenerator,
                          ISpeedsGenerator speedsGenerator,
                          IEquipmentGenerator equipmentGenerator,
                          IMagicGenerator magicGenerator,
                          ILanguageGenerator languageGenerator)
 {
     this.alignmentGenerator   = alignmentGenerator;
     this.abilitiesGenerator   = abilitiesGenerator;
     this.skillsGenerator      = skillsGenerator;
     this.featsGenerator       = featsGenerator;
     this.creatureVerifier     = creatureVerifier;
     this.collectionsSelector  = collectionsSelector;
     this.creatureDataSelector = creatureDataSelector;
     this.hitPointsGenerator   = hitPointsGenerator;
     this.armorClassGenerator  = armorClassGenerator;
     this.savesGenerator       = savesGenerator;
     this.justInTimeFactory    = justInTimeFactory;
     this.advancementSelector  = advancementSelector;
     this.attacksGenerator     = attacksGenerator;
     this.speedsGenerator      = speedsGenerator;
     this.equipmentGenerator   = equipmentGenerator;
     this.magicGenerator       = magicGenerator;
     this.languageGenerator    = languageGenerator;
 }
        public void Setup()
        {
            mockAdjustmentsSelector = new Mock<IAdjustmentsSelector>();
            mockCollectionsSelector = new Mock<ICollectionsSelector>();
            armorClassGenerator = new ArmorClassGenerator(mockCollectionsSelector.Object, mockAdjustmentsSelector.Object);
            equipment = new Equipment();
            feats = new List<Feat>();
            armorBonuses = new Dictionary<string, int>();
            sizeModifiers = new Dictionary<string, int>();
            adjustedDexterityBonus = 0;
            race = new Race();

            armorBonuses[string.Empty] = 0;
            mockAdjustmentsSelector.Setup(s => s.SelectFrom(TableNameConstants.Set.Adjustments.ArmorBonuses)).Returns(armorBonuses);
            mockAdjustmentsSelector.Setup(s => s.SelectFrom(TableNameConstants.Set.Adjustments.SizeModifiers)).Returns(sizeModifiers);
            mockCollectionsSelector.Setup(s => s.SelectFrom(TableNameConstants.Set.Collection.ArmorClassModifiers, GroupConstants.Size))
                .Returns(Enumerable.Empty<string>());
            mockCollectionsSelector.Setup(s => s.SelectFrom(TableNameConstants.Set.Collection.ArmorClassModifiers, GroupConstants.NaturalArmor))
                .Returns(Enumerable.Empty<string>());
            mockCollectionsSelector.Setup(s => s.SelectFrom(TableNameConstants.Set.Collection.ArmorClassModifiers, GroupConstants.Deflection))
                .Returns(Enumerable.Empty<string>());

            race.Size = "size";
            sizeModifiers["size"] = 0;
            sizeModifiers["other size"] = 0;
        }