示例#1
0
        public HalfFiendApplicator(
            ICollectionSelector collectionSelector,
            ITypeAndAmountSelector typeAndAmountSelector,
            ISpeedsGenerator speedsGenerator,
            IAttacksGenerator attacksGenerator,
            IFeatsGenerator featsGenerator,
            ISkillsGenerator skillsGenerator,
            Dice dice,
            IMagicGenerator magicGenerator)
        {
            this.collectionSelector    = collectionSelector;
            this.typeAndAmountSelector = typeAndAmountSelector;
            this.speedsGenerator       = speedsGenerator;
            this.attacksGenerator      = attacksGenerator;
            this.featsGenerator        = featsGenerator;
            this.skillsGenerator       = skillsGenerator;
            this.dice           = dice;
            this.magicGenerator = magicGenerator;

            creatureTypes = new[]
            {
                CreatureConstants.Types.Aberration,
                CreatureConstants.Types.Animal,
                CreatureConstants.Types.Dragon,
                CreatureConstants.Types.Elemental,
                CreatureConstants.Types.Fey,
                CreatureConstants.Types.Giant,
                CreatureConstants.Types.Humanoid,
                CreatureConstants.Types.MagicalBeast,
                CreatureConstants.Types.MonstrousHumanoid,
                CreatureConstants.Types.Ooze,
                CreatureConstants.Types.Plant,
                CreatureConstants.Types.Vermin,
            };
        }
示例#2
0
        public GhostApplicator(
            Dice dice,
            ISpeedsGenerator speedsGenerator,
            IAttacksGenerator attacksGenerator,
            ICollectionSelector collectionSelector,
            IFeatsGenerator featsGenerator,
            IItemsGenerator itemsGenerator,
            ITypeAndAmountSelector typeAndAmountSelector)
        {
            this.dice                  = dice;
            this.speedsGenerator       = speedsGenerator;
            this.attacksGenerator      = attacksGenerator;
            this.collectionSelector    = collectionSelector;
            this.featsGenerator        = featsGenerator;
            this.itemsGenerator        = itemsGenerator;
            this.typeAndAmountSelector = typeAndAmountSelector;

            creatureTypes = new[]
            {
                CreatureConstants.Types.Aberration,
                CreatureConstants.Types.Animal,
                CreatureConstants.Types.Dragon,
                CreatureConstants.Types.Giant,
                CreatureConstants.Types.Humanoid,
                CreatureConstants.Types.MagicalBeast,
                CreatureConstants.Types.MonstrousHumanoid,
                CreatureConstants.Types.Plant,
            };
        }
示例#3
0
        public ZombieApplicator(
            ICollectionSelector collectionSelector,
            IAdjustmentsSelector adjustmentSelector,
            Dice dice,
            IAttacksGenerator attacksGenerator,
            IFeatsGenerator featsGenerator,
            ISavesGenerator savesGenerator,
            IHitPointsGenerator hitPointsGenerator)
        {
            this.collectionSelector = collectionSelector;
            this.adjustmentSelector = adjustmentSelector;
            this.dice               = dice;
            this.attacksGenerator   = attacksGenerator;
            this.featsGenerator     = featsGenerator;
            this.savesGenerator     = savesGenerator;
            this.hitPointsGenerator = hitPointsGenerator;

            creatureTypes = new[]
            {
                CreatureConstants.Types.Aberration,
                CreatureConstants.Types.Animal,
                CreatureConstants.Types.Dragon,
                CreatureConstants.Types.Elemental,
                CreatureConstants.Types.Fey,
                CreatureConstants.Types.Giant,
                CreatureConstants.Types.Humanoid,
                CreatureConstants.Types.MagicalBeast,
                CreatureConstants.Types.MonstrousHumanoid,
                CreatureConstants.Types.Vermin,
            };
        }
示例#4
0
        public LycanthropeApplicator(
            ICollectionSelector collectionSelector,
            ICreatureDataSelector creatureDataSelector,
            IHitPointsGenerator hitPointsGenerator,
            Dice dice,
            ITypeAndAmountSelector typeAndAmountSelector,
            IFeatsGenerator featsGenerator,
            IAttacksGenerator attacksGenerator,
            ISavesGenerator savesGenerator,
            ISkillsGenerator skillsGenerator,
            ISpeedsGenerator speedsGenerator)
        {
            this.collectionSelector   = collectionSelector;
            this.creatureDataSelector = creatureDataSelector;
            this.hitPointsGenerator   = hitPointsGenerator;
            this.dice = dice;
            this.typeAndAmountSelector = typeAndAmountSelector;
            this.featsGenerator        = featsGenerator;
            this.attacksGenerator      = attacksGenerator;
            this.savesGenerator        = savesGenerator;
            this.skillsGenerator       = skillsGenerator;
            this.speedsGenerator       = speedsGenerator;

            creatureTypes = new[]
            {
                CreatureConstants.Types.Giant,
                CreatureConstants.Types.Humanoid,
            };
        }
 public HalfDragonRedApplicator(
     ICollectionSelector collectionSelector,
     ISpeedsGenerator speedsGenerator,
     IAttacksGenerator attacksGenerator,
     IFeatsGenerator featsGenerator,
     ISkillsGenerator skillsGenerator,
     IAlignmentGenerator alignmentGenerator,
     Dice dice,
     IMagicGenerator magicGenerator)
     : base(collectionSelector, speedsGenerator, attacksGenerator, featsGenerator, skillsGenerator, alignmentGenerator, dice, magicGenerator)
 {
 }
示例#6
0
        /// <summary>
        /// Generates magic bitboards for the specified parameters.
        /// </summary>
        /// <param name="attacksGenerator">The attacks generator.</param>
        /// <param name="patternBitsCount">The array of pattern set bits count.</param>
        /// <param name="keys">The array of magic keys.</param>
        /// <returns>The array of fields containing a list of possible attacks for bishop (accessed by magic keys).</returns>
        public ulong[][] GenerateMagicBitboards(IAttacksGenerator attacksGenerator, int[] patternBitsCount, ulong[] keys)
        {
            var bishopAttacks = new ulong[64][];

            for (var i = 0; i < 64; i++)
            {
                var attacks       = attacksGenerator.Generate(i);
                var maskBitsCount = patternBitsCount[i];

                bishopAttacks[i] = GenerateMagicAttacks(attacks, keys, maskBitsCount, i);
            }

            return(bishopAttacks);
        }
示例#7
0
 public LichApplicator(
     ICollectionSelector collectionSelector,
     ICreatureDataSelector creatureDataSelector,
     Dice dice,
     IAttacksGenerator attacksGenerator,
     IFeatsGenerator featsGenerator,
     ITypeAndAmountSelector typeAndAmountSelector)
 {
     this.collectionSelector   = collectionSelector;
     this.creatureDataSelector = creatureDataSelector;
     this.dice                  = dice;
     this.attacksGenerator      = attacksGenerator;
     this.featsGenerator        = featsGenerator;
     this.typeAndAmountSelector = typeAndAmountSelector;
 }
示例#8
0
        /// <summary>
        /// Calculates magic keys for the specified piece.
        /// </summary>
        /// <param name="attacksGenerator">RookAttacksGenerator for rook or BishopAttacksGenerator for bishop</param>
        /// <param name="pieceAttackPatterns">BishopAttacksGenerator for rook PatternsContainer.BishopPattern for bishop</param>
        /// <returns>Array of magic keys for the specified piece</returns>
        private ulong[] GetKeys(IAttacksGenerator attacksGenerator, ulong[] pieceAttackPatterns)
        {
            var keys = new ulong[64];

            for (var fieldIndex = 0; fieldIndex < 64; fieldIndex++)
            {
                var mask       = pieceAttackPatterns[fieldIndex];
                var maskLength = BitOperations.Count(mask);

                var patterns = attacksGenerator.Generate(fieldIndex);

                keys[fieldIndex] = _magicKeyGenerator.GenerateKey(patterns, maskLength);
                DisplayStatus(fieldIndex, keys[fieldIndex], maskLength, patterns.Count);
            }

            return(keys);
        }
示例#9
0
        public VampireApplicator(
            Dice dice,
            IAttacksGenerator attacksGenerator,
            IFeatsGenerator featsGenerator,
            ICollectionSelector collectionSelector,
            ICreatureDataSelector creatureDataSelector,
            IAdjustmentsSelector adjustmentSelector)
        {
            this.dice                 = dice;
            this.attacksGenerator     = attacksGenerator;
            this.featsGenerator       = featsGenerator;
            this.collectionSelector   = collectionSelector;
            this.creatureDataSelector = creatureDataSelector;
            this.adjustmentSelector   = adjustmentSelector;

            creatureTypes = new[]
            {
                CreatureConstants.Types.Humanoid,
                CreatureConstants.Types.MonstrousHumanoid,
            };
        }
示例#10
0
        public CelestialCreatureApplicator(IAttacksGenerator attackGenerator, IFeatsGenerator featGenerator, ICollectionSelector collectionSelector, IMagicGenerator magicGenerator)
        {
            this.attackGenerator    = attackGenerator;
            this.featGenerator      = featGenerator;
            this.collectionSelector = collectionSelector;
            this.magicGenerator     = magicGenerator;

            creatureTypes = new[]
            {
                CreatureConstants.Types.Aberration,
                CreatureConstants.Types.Animal,
                CreatureConstants.Types.Dragon,
                CreatureConstants.Types.Fey,
                CreatureConstants.Types.Giant,
                CreatureConstants.Types.Humanoid,
                CreatureConstants.Types.MagicalBeast,
                CreatureConstants.Types.MonstrousHumanoid,
                CreatureConstants.Types.Plant,
                CreatureConstants.Types.Vermin,
            };
        }
 public LycanthropeBoarNaturalApplicator(
     ICollectionSelector collectionSelector,
     ICreatureDataSelector creatureDataSelector,
     IHitPointsGenerator hitPointsGenerator,
     Dice dice,
     ITypeAndAmountSelector typeAndAmountSelector,
     IFeatsGenerator featsGenerator,
     IAttacksGenerator attacksGenerator,
     ISavesGenerator savesGenerator,
     ISkillsGenerator skillsGenerator,
     ISpeedsGenerator speedsGenerator)
     : base(
         collectionSelector,
         creatureDataSelector,
         hitPointsGenerator,
         dice,
         typeAndAmountSelector,
         featsGenerator,
         attacksGenerator,
         savesGenerator,
         skillsGenerator,
         speedsGenerator)
 {
 }
示例#12
0
 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;
 }