Ejemplo n.º 1
0
        public void Switch(EShopState state)
        {
            if (state == EShopState.ShortView)
            {
                var showedCard = 0;
                _shopCardDatas.ForEach(shopLotData =>
                {
                    bool condition = showedCard < 2 && shopLotData.isBigSize ||
                                     showedCard < 5 && !shopLotData.isBigSize;
                    shopLotData.Enabled = condition;

                    if (shopLotData.Enabled)
                    {
                        showedCard++;
                    }

                    shopLotData.NotifyThatDataChanged();
                });
            }
            else if (state == EShopState.FullView)
            {
                _shopCardDatas.ForEach(shopLotData =>
                {
                    shopLotData.Enabled = true;
                    shopLotData.NotifyThatDataChanged();
                });
            }
        }
Ejemplo n.º 2
0
        public void ChangeState(EShopState state)
        {
            if (_data.State == EShopState.Disabled)
            {
                state = EShopState.ShortView;
            }

            _data.SetState(state);
            _data.NotifyThatDataChanged();
        }
Ejemplo n.º 3
0
 public void SetState(EShopState state)
 {
     _shopCardStateSwitcher.Switch(state);
     State = state;
 }