Пример #1
0
 private static void AddShopUnits(int amount, IShopPanelView shopPanel,
                                  IUnitPool <IShopUnitModel> unitPool, IShopFactory shopFactory,
                                  IRandomUnitGenerator unitGenerator)
 {
     amount.Times(() => unitPool.AddUnit(shopFactory.Create(unitGenerator.GetRandomUnitId(), shopPanel.UnitParent)));
     // create unit controller with preparation unit factory
 }
Пример #2
0
        public ShopPanelController(IShopPanelView view, IShopConfig config, IShopFactory factory,
                                   IUnitPool <IShopUnitModel> shopPool, IRandomUnitGenerator unitGenerator, IEventBus eventBus, IDisposer disposer)
        {
            _eventBus = eventBus;
            view.CloseButton.OnClickAsObservable()
            .Merge(view.BackgroundButton.OnClickAsObservable())
            .SubscribeBlind(() => ClosePanel(view))
            .AddToDisposer(disposer);

            // open panel on event
            eventBus.OnEvent <OpenShopCommand>().SubscribeBlind(view.Open).AddToDisposer(disposer);

            // only spawn items once shop is first opened
            AddShopUnits(config.ShopEntryAmount, view, shopPool, factory, unitGenerator);
        }
Пример #3
0
 public ETLService(IBufferService bufferService,
                   IShopRepository shopRepository,
                   IProductRepository productRepository,
                   ITransactionRepository transactionRepository,
                   ITransactionProductRepository transactionProductRepository,
                   IUnitOfWork unitOfWork,
                   IProductFactory productFactory,
                   IShopFactory shopFactory,
                   ITransactionFactory transactionFactory,
                   ITransactionProductFactory transactionProductFactory)
 {
     _bufferService                = bufferService;
     _shopRepository               = shopRepository;
     _productRepository            = productRepository;
     _transactionRepository        = transactionRepository;
     _transactionProductRepository = transactionProductRepository;
     _unitOfWork                = unitOfWork;
     _productFactory            = productFactory;
     _shopFactory               = shopFactory;
     _transactionFactory        = transactionFactory;
     _transactionProductFactory = transactionProductFactory;
 }
Пример #4
0
 public ShopController(IShopFactory factory)
 {
     this.factory      = factory;
     this.orderService = factory.OrderService;
 }
Пример #5
0
 public CommerceGraphQL(IShopFactory shopFactory)
 {
     this.shopFactory = shopFactory;
 }