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(); }); } }
public void ChangeState(EShopState state) { if (_data.State == EShopState.Disabled) { state = EShopState.ShortView; } _data.SetState(state); _data.NotifyThatDataChanged(); }
public void SetState(EShopState state) { _shopCardStateSwitcher.Switch(state); State = state; }