private void SetThisSelectorWithThisInvestigator(InvestigatorSelectorView selector, string investigatorId)
        {
            Sprite spriteCard = cardsManager.GetSpriteCard(investigatorId);

            selector.SetSelector(investigatorId, spriteCard);
            investigatorSelectorsManager.RebuildPlaceHolders();
        }
        public InvestigatorSelectorView AddInvestigatorToSelector(string investigatorId)
        {
            InvestigatorSelectorView selector = investigatorSelectorsManager.GetEmptySelector();

            SetThisSelectorWithThisInvestigator(selector, investigatorId);
            return(selector);
        }
        /*******************************************************************/
        public void AddInvestigator(InvestigatorSelectorView selector, string investigatorId)
        {
            IShowable showablewCard = cardManager.GetInvestigatorCard(investigatorId);

            Move(showablewCard, selector.SensorPosition);
            selector.SetImageAnimation();
        }
        public void SwapPlaceHoldersWith(InvestigatorSelectorView otherSelector)
        {
            int selector1Index = Sensor.GetSiblingIndex();

            Sensor.SetSiblingIndex(otherSelector.Sensor.GetSiblingIndex());
            otherSelector.Sensor.SetSiblingIndex(selector1Index);
        }
示例#5
0
        private void UpdateView(string investigatorId)
        {
            InvestigatorSelectorView selector = investigatorSelector.AddInvestigatorToSelector(investigatorId);

            multiAnimator.AddInvestigator(selector, investigatorId);
            investigatorSelector.SetLeadSelector();
            selectInvestigatorUseCase.Select(investigatorId);
            investigatorVisibility.RefreshInvestigatorsSelectability();
            multiAnimator.ReshowCardInvestigator(investigatorId);
            buttonsPresenter.AutoActivateReadyButton();
        }
        public void RemoveInvestigator(string investigatorId)
        {
            InvestigatorSelectorView selector = investigatorSelectorsManager.GetSelectorById(investigatorId);

            selector.ActivateSensor(false);
            Animation();

            void Animation()
            {
                investigatorSelectorsManager.ArrangeAllSelectors();
                selector.RemoveAnimation().OnComplete(selector.EmptySelector);
            }
        }
        public void ChangeInvestigator(string investigatorId1, string investigatorId2)
        {
            InvestigatorSelectorView selector1 = investigatorSelectorsManager.GetSelectorById(investigatorId1);
            InvestigatorSelectorView selector2 = investigatorSelectorsManager.GetSelectorById(investigatorId2);

            selector1.SwapPlaceHoldersWith(selector2);
            Animation();

            void Animation()
            {
                investigatorSelectorsManager.RebuildPlaceHolders();
                selector1.ArrangeAnimation();
            }
        }
        /*******************************************************************/
        public void InitializeSelectors()
        {
            investigatorSelectorsManager.ResetSelectors();
            AddAllInvestigators();
            investigatorSelectUseCase.SelectLead();

            void AddAllInvestigators()
            {
                foreach (string investigatorId in selectorRepository.InvestigatorsIdInSelector)
                {
                    InvestigatorSelectorView selector = investigatorSelectorsManager.GetEmptySelector();
                    SetThisSelectorWithThisInvestigator(selector, investigatorId);
                    selector.PosicionateCardOn();
                }
            }
        }
        public void SwapImageSelector(string cardId)
        {
            InvestigatorSelectorView selector = investigatorSelectorsManager.GetSelectorById(cardId);

            if (selector == null)
            {
                return;
            }
            dotweenService.SwapImage(selector.CardVisual, SetSelector);

            void SetSelector()
            {
                Sprite image = cardsManager.GetCard(cardId).FrontImage;

                selector?.ChangeImage(image);
            }
        }