예제 #1
0
 public PercentileSelectorStringReplacementDecorator(
     IPercentileSelector innerSelector,
     IReplacementSelector replacementSelector)
 {
     this.innerSelector       = innerSelector;
     this.replacementSelector = replacementSelector;
 }
예제 #2
0
 public PotionGenerator(
     ITypeAndAmountPercentileSelector typeAndAmountPercentileSelector,
     ICollectionSelector collectionSelector,
     IReplacementSelector replacementSelector)
 {
     this.typeAndAmountPercentileSelector = typeAndAmountPercentileSelector;
     this.collectionSelector  = collectionSelector;
     this.replacementSelector = replacementSelector;
 }
예제 #3
0
 public MundaneWeaponGenerator(
     ITreasurePercentileSelector percentileSelector,
     ICollectionSelector collectionsSelector,
     Dice dice,
     IWeaponDataSelector weaponDataSelector,
     IReplacementSelector replacementSelector)
 {
     this.percentileSelector  = percentileSelector;
     this.collectionsSelector = collectionsSelector;
     this.dice = dice;
     this.weaponDataSelector  = weaponDataSelector;
     this.replacementSelector = replacementSelector;
 }
예제 #4
0
 public RingGenerator(
     ICollectionSelector collectionsSelector,
     ISpellGenerator spellGenerator,
     IChargesGenerator chargesGenerator,
     ITypeAndAmountPercentileSelector typeAndAmountPercentileSelector,
     IReplacementSelector replacementSelector)
 {
     this.collectionsSelector             = collectionsSelector;
     this.spellGenerator                  = spellGenerator;
     this.chargesGenerator                = chargesGenerator;
     this.typeAndAmountPercentileSelector = typeAndAmountPercentileSelector;
     this.replacementSelector             = replacementSelector;
 }
예제 #5
0
 public SpecificGearGenerator(ITypeAndAmountPercentileSelector typeAndAmountPercentileSelector,
                              ICollectionSelector collectionsSelector,
                              IChargesGenerator chargesGenerator,
                              ITreasurePercentileSelector percentileSelector,
                              ISpellGenerator spellGenerator,
                              ISpecialAbilitiesGenerator specialAbilitiesGenerator,
                              JustInTimeFactory justInTimeFactory,
                              IReplacementSelector replacementSelector)
 {
     this.typeAndAmountPercentileSelector = typeAndAmountPercentileSelector;
     this.collectionsSelector             = collectionsSelector;
     this.chargesGenerator          = chargesGenerator;
     this.percentileSelector        = percentileSelector;
     this.spellGenerator            = spellGenerator;
     this.specialAbilitiesGenerator = specialAbilitiesGenerator;
     this.justInTimeFactory         = justInTimeFactory;
     this.replacementSelector       = replacementSelector;
 }
예제 #6
0
        public void Setup()
        {
            mockCollectionSelector = new Mock <ICollectionSelector>();

            replacements           = new Dictionary <string, IEnumerable <string> >();
            replacements["FIRST"]  = new[] { "1st", "the first" };
            replacements["SECOND"] = new[] { "2nd", "the second" };
            replacements["SINGLE"] = new[] { "the only one" };

            mockCollectionSelector
            .Setup(s => s.SelectAllFrom(TableNameConstants.Collections.Set.ReplacementStrings))
            .Returns(replacements);

            var index = 0;

            mockCollectionSelector
            .Setup(s => s.SelectRandomFrom(It.IsAny <IEnumerable <string> >()))
            .Returns((IEnumerable <string> c) => c.ElementAt(index++ % c.Count()));

            replacementSelector = new ReplacementSelector(mockCollectionSelector.Object);
        }
예제 #7
0
 public void Setup()
 {
     typeAndAmountPercentileSelector = GetNewInstanceOf <ITypeAndAmountPercentileSelector>();
     replacementSelector             = GetNewInstanceOf <IReplacementSelector>();
     percentileSelector = GetNewInstanceOf <IPercentileSelector>();
 }