Beispiel #1
0
 public ItemsGenerator(ITypeAndAmountPercentileSelector typeAndAmountPercentileSelector, IMundaneItemGeneratorRuntimeFactory mundaneItemGeneratorFactory, IPercentileSelector percentileSelector, IMagicalItemGeneratorRuntimeFactory magicalItemGeneratorFactory, IRangeAttributesSelector rangeAttributesSelector)
 {
     this.typeAndAmountPercentileSelector = typeAndAmountPercentileSelector;
     this.mundaneItemGeneratorFactory     = mundaneItemGeneratorFactory;
     this.percentileSelector          = percentileSelector;
     this.magicalItemGeneratorFactory = magicalItemGeneratorFactory;
     this.rangeAttributesSelector     = rangeAttributesSelector;
 }
        public void Setup()
        {
            mockMundaneItemGenerators = new Dictionary <string, Mock <MundaneItemGenerator> >();
            mockMundaneItemGenerators[ItemTypeConstants.Armor]          = new Mock <MundaneItemGenerator>();
            mockMundaneItemGenerators[ItemTypeConstants.AlchemicalItem] = new Mock <MundaneItemGenerator>();
            mockMundaneItemGenerators[ItemTypeConstants.Tool]           = new Mock <MundaneItemGenerator>();
            mockMundaneItemGenerators[ItemTypeConstants.Weapon]         = new Mock <MundaneItemGenerator>();

            factory = new MundaneItemGeneratorRuntimeFactory(mockMundaneItemGenerators[ItemTypeConstants.Armor].Object, mockMundaneItemGenerators[ItemTypeConstants.Weapon].Object, mockMundaneItemGenerators[ItemTypeConstants.Tool].Object, mockMundaneItemGenerators[ItemTypeConstants.AlchemicalItem].Object);
        }
        public EncounterTreasureGenerator(ICoinGenerator coinGenerator, IGoodsGenerator goodsGenerator, IItemsGenerator itemsGenerator, IAdjustmentSelector adjustmentSelector,
            IBooleanPercentileSelector booleanPercentileSelector, ICollectionSelector collectionSelector, IMagicalItemGeneratorRuntimeFactory magicalItemGeneratorRuntimeFactory, IMundaneItemGeneratorRuntimeFactory mundaneItemGeneratorRuntimeFactory)
        {
            this.coinGenerator = coinGenerator;
            this.goodsGenerator = goodsGenerator;
            this.itemsGenerator = itemsGenerator;
            this.adjustmentSelector = adjustmentSelector;
            this.booleanPercentileSelector = booleanPercentileSelector;
            this.collectionSelector = collectionSelector;
            this.magicalItemGeneratorRuntimeFactory = magicalItemGeneratorRuntimeFactory;
            this.mundaneItemGeneratorRuntimeFactory = mundaneItemGeneratorRuntimeFactory;

            subTypeRegex = new Regex(RegexConstants.DescriptionPattern);
            itemTypeRegex = new Regex(RegexConstants.ItemTypePattern);
            itemBonusRegex = new Regex(RegexConstants.ItemBonusPattern);
            specialAbilityRegex = new Regex(RegexConstants.SpecialAbilitiesPattern);
            traitRegex = new Regex(RegexConstants.TraitPattern);
        }