Пример #1
0
        private void UpdateCountPointsPhase(Time deltaTime)
        {
            if (this.currenDomainEvaluatedIndex >= 0)
            {
                CJStarDomain2D currentDomainEvaluated = this.domainsOwnedByPlayers[this.currenDomainEvaluatedIndex];

                if (currentDomainEvaluated.IsAnimationRunning() == false)
                {
                    currentDomainEvaluated.Priority = (this.object2DToObjects[currentDomainEvaluated] as CJStarDomain).Priority;

                    this.currenDomainEvaluatedIndex++;
                    if (this.currenDomainEvaluatedIndex < this.domainsOwnedByPlayers.Count)
                    {
                        this.EvaluateDomain(this.currenDomainEvaluatedIndex);
                    }
                    else
                    {
                        this.currenDomainEvaluatedIndex = -1;
                    }
                }
            }
            else
            {
                this.EndDomainEvaluated?.Invoke();
            }
        }
Пример #2
0
        private void EvaluateDomain(int index)
        {
            this.currenDomainEvaluatedIndex = index;
            CJStarDomain2D domainToEvaluate = this.domainsOwnedByPlayers[index];

            domainToEvaluate.Priority = 4000;
            this.domainsOwnedByPlayers[index].PlayAnimation(0);

            this.DomainEvaluated?.Invoke(this.object2DToObjects[domainToEvaluate] as CJStarDomain);
        }
Пример #3
0
        public override void InitializeLayer(IObject2DFactory factory)
        {
            this.maxAwakenedPriority = 0;

            this.cardsOnBoard.Clear();
            this.domainsOwnedByPlayers.Clear();

            this.linksFocused.Clear();

            this.sourceCardEntities = null;
            this.sourceStarEntities = null;
            this.targetCardEntities = null;
            this.targetStarEntities = null;

            base.InitializeLayer(factory);

            this.LevelTurnPhase = TurnPhase.VOID;

            this.cardPicked    = null;
            this.cardFocused   = null;
            this.domainFocused = null;
        }
Пример #4
0
        protected override void OnEntityPropertyChanged(AEntity obj, string propertyName)
        {
            base.OnEntityPropertyChanged(obj, propertyName);

            switch (propertyName)
            {
            case "CardSocketed":
                StarEntity   starEntity   = obj as StarEntity;
                StarEntity2D starEntity2D = this.objectToObject2Ds[obj] as StarEntity2D;

                starEntity2D.SetCardSocketed(starEntity.CardSocketed);
                break;

            case "IsSocketed":
                (this.objectToObject2Ds[obj] as CardEntity2D).IsSocketed = ((obj as CardEntity).ParentStar != null);
                break;

            case "IsFliped":
                (this.objectToObject2Ds[obj] as CardEntity2D).IsFliped = (obj as CardEntity).IsFliped;
                break;

            case "IsSelected":
                (this.objectToObject2Ds[obj] as CardEntity2D).IsSelected = (obj as CardEntity).IsSelected;
                break;

            case "IsAwakened":
                CardEntity2D cardAwakened = this.objectToObject2Ds[obj] as CardEntity2D;
                cardAwakened.IsAwakened = (obj as CardEntity).Card.IsAwakened;

                cardAwakened.Priority = 2000 + this.maxAwakenedPriority++;
                break;

            case "IsActive":
                this.objectToObject2Ds[obj].IsActive = (obj as AEntity).IsActive;
                break;

            case "CurrentOwner":
                CardEntity cardConcerned = obj as CardEntity;

                (this.objectToObject2Ds[cardConcerned] as CardEntity2D).PlayerColor = cardConcerned.Card.CurrentOwner.PlayerColor;
                (this.objectToObject2Ds[cardConcerned.ParentStar] as StarEntity2D).SetCardSocketed(cardConcerned);
                break;

            case "Value":
                CardEntity2D card2DChanged = this.objectToObject2Ds[obj] as CardEntity2D;
                CardEntity   cardChanged   = obj as CardEntity;
                card2DChanged.CardValue         = cardChanged.Card.Value;
                card2DChanged.CardValueModifier = cardChanged.Card.ValueModifier;
                break;

            case "DomainOwner":
                CJStarDomain2D domain2DChanged = this.objectToObject2Ds[obj] as CJStarDomain2D;
                CJStarDomain   domainChanged   = (obj as CJStarDomain);

                if (domainChanged.DomainOwner != null)
                {
                    domain2DChanged.TargetedColor = domainChanged.DomainOwner.PlayerColor;
                }
                else
                {
                    domain2DChanged.TargetedColor = Color.Black;
                }
                break;
            }
        }