Ejemplo n.º 1
0
        public CurrencyFactory(
            IRandom random,
            EssenceFactory essenceFactory,
            FossilFactory fossilFactory,
            MasterModFactory masterModFactory)
        {
            _currencyStepExecutor = new CurrencyStepExecutor(random);
            _currencyStepFactory  = new CurrencyStepFactory(_currencyStepExecutor);

            _currencyRequirementValidator = new CurrencyRequirementValidator();
            _currencyRequirementFactory   =
                new CurrencyRequirementFactory(_currencyRequirementValidator);
            _currencyModifiersFactory = new CurrencyModifiersFactory();

            var currency            = GetDefaultCurrency();
            var essenceCurrency     = essenceFactory.Essence.Select(EssenceToCurrency);
            var masterCraftCurrency = masterModFactory.MasterMod.GroupBy(x => x.Name).Select(MasterModToCurrency).ToList();

            masterCraftCurrency.Add(RemoveMasterCrafts());

            _corruptedEssences = essenceFactory.Essence.Where(x => x.Tier == 6).ToList();
            var fossilCurrency = fossilFactory.Fossils.Select(x => FossilsToCurrency(new List <Fossil>()
            {
                x
            })).ToList();

            _currency = currency.Union(fossilCurrency)
                        .Union(essenceCurrency)
                        .Union(masterCraftCurrency)
                        .ToDictionary(x => x.Name, x => x);

            _fossils = fossilFactory.Fossils.ToDictionary(x => x.Name, x => x);

            _essences = essenceFactory.Essence.ToDictionary(x => x.Name, x => x);
        }
Ejemplo n.º 2
0
        public MapperTests()
        {
            AffixFactory affixFactory = new AffixFactory();

            _itemFactory      = new ItemFactory(affixFactory);
            _fossilFactory    = new FossilFactory(affixFactory);
            _masterModFactory = new MasterModFactory(affixFactory, _itemFactory);
            _essenceFactory   = new EssenceFactory(_itemFactory, affixFactory);
        }
Ejemplo n.º 3
0
        public CraftingSimulator(
            SimBaseItemInfo baseItemInfo,
            SimFinanceInfo financeInfo,
            SimCraftingInfo craftingInfo)
        {
            _affixFactory     = new AffixFactory();
            _itemFactory      = new ItemFactory(_affixFactory);
            _fossilFactory    = new FossilFactory(_affixFactory);
            _masterModFactory = new MasterModFactory(_affixFactory, _itemFactory);
            _essenceFactory   = new EssenceFactory(_itemFactory, _affixFactory);

            var currencyFactory = new CurrencyFactory(
                new PoeRandom(),
                _essenceFactory,
                _fossilFactory,
                _masterModFactory);

            var clientToDomainMapper = new ClientToDomainMapper(_itemFactory, currencyFactory);
            var domainToClientMapper = new DomainToClientMapper();

            _clientToDomain = clientToDomainMapper.GenerateMapper();
            _domainToClient = domainToClientMapper.GenerateMapper();

            _financeInfo  = financeInfo;
            _craftingInfo = craftingInfo;
            _baseItemInfo = baseItemInfo;

            _baseItem = _itemFactory.Items.First(x => x.Name == _baseItemInfo.ItemName);

            var itemAffixes = _affixFactory.GetAffixesForItem(
                _baseItem.Tags,
                _baseItem.ItemClass,
                _baseItemInfo.ItemLevel);

            var fossilAffixes = _fossilFactory.Fossils
                                .SelectMany(x => x.AddedAffixes)
                                .ToList();

            var essenceAffixes = _essenceFactory.GetAffixesByItemClass(_baseItem.ItemClass)
                                 .ToList();

            var currencyAffixes = fossilAffixes.Union(essenceAffixes).ToList();

            var influences         = new List <Influence>((Influence[])Enum.GetValues(typeof(Influence)));
            var affixesByInfluence =
                _affixFactory.GetAffixesByInfluence(influences, _baseItem.ItemClass, _baseItemInfo.ItemLevel);
            var influenceSpawnTag = _affixFactory.GetInfluenceSpawnTags(_baseItem.ItemClass);

            _affixManager = new AffixManager(_baseItem, itemAffixes, currencyAffixes, affixesByInfluence,
                                             influenceSpawnTag);
            _currencyValues = _currencyValueFactory.GetCurrencyValues(financeInfo.League);
        }
Ejemplo n.º 4
0
        public CurrencyTestHelper()
        {
            AffixFactory     = new AffixFactory();
            ItemFactory      = new ItemFactory(AffixFactory);
            EssenceFactory   = new EssenceFactory(ItemFactory, AffixFactory);
            FossilFactory    = new FossilFactory(AffixFactory);
            MasterModFactory = new MasterModFactory(AffixFactory, ItemFactory);

            Random          = new PoeRandom();
            CurrencyFactory = new CurrencyFactory(
                Random,
                EssenceFactory,
                FossilFactory,
                MasterModFactory);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Will launch a StarCraft II client and attempt to gather information using the DataRequest.
        /// </summary>
        /// <param name="log">Optional log</param>
        /// <returns></returns>
        private static Essence FetchDataFromClient(ILogger log = null)
        {
            var factory = new EssenceFactory(log);

            return(factory.FetchFromClient(Defaults.GameSettings));
        }
Ejemplo n.º 6
0
 public AffixFactoryTest()
 {
     _affixFactory   = new AffixFactory();
     _itemFactory    = new ItemFactory(_affixFactory);
     _essenceFactory = new EssenceFactory(_itemFactory, _affixFactory);
 }
Ejemplo n.º 7
0
 private void Awake()
 {
     activePointer  = FindObjectOfType <WorldPointer>();
     essenceFactory = new EssenceFactory(essenceSets, transform);
 }