public ShopListPresenter(
     IShopItemUseCase shopItemUseCase,
     ShopItemFactory shopItemFactory,
     RectTransform content)
 {
     _shopItemUseCase = shopItemUseCase;
     _shopItemFactory = shopItemFactory;
     _content         = content;
 }
Beispiel #2
0
        /// <summary>
        /// Decodes this instance.
        /// </summary>
        internal void Decode(ByteStream Packet)
        {
            for (int i = Packet.ReadVInt(); i > 0; i--)
            {
                ShopItem ShopItem = ShopItemFactory.CreateShopItem(Packet.ReadVInt());

                if (ShopItem != null)
                {
                    ShopItem.Decode(Packet);
                    this.Items.Add(ShopItem);
                }
            }
        }
Beispiel #3
0
        static void Main(string[] args)
        {
            Rozetka rozetka = new Rozetka();

            List <IShopItem> shopItemsList = new List <IShopItem>()
            {
                ShopItemFactory.createShopItem("Laptop1", "High perfomance laptop", "path/to/image1", CategoryType.ELECTRONIC),
                ShopItemFactory.createShopItem("Laptop2", "Medium perfomance laptop", "path/to/image2", CategoryType.ELECTRONIC),
                ShopItemFactory.createShopItem("Laptop3", "Low perfomance laptop", "path/to/image3", CategoryType.ELECTRONIC),
                ShopItemFactory.createShopItem("Shoes", "44 size", "path/to/image4", CategoryType.CLOTHES),
                ShopItemFactory.createShopItem("T-shirt", "35 size", "path/to/image5", CategoryType.CLOTHES),
                ShopItemFactory.createShopItem("Toy", "Fot kids", "path/to/image6", CategoryType.UNEXISTED_CATEGORY),
                ShopItemFactory.createLegacyShopItem("Headphones", "64OM"),
            };

            shopItemsList.ForEach(item => {
                rozetka.addNewItem(item);
            });

            rozetka.printShopItems();
        }