public void animatePlayAsManaOPP(int cardID)
        {
            Models.CardGUIModel        card;
            Animations.MoveAnimation   moveAnimation;
            Animations.RotateAnimation rotateAnimation;

            // create the origin and destination cards

            card = new Models.CardGUIModel(ctrl.getCardWithGamePropertiesByID(cardID), this, AnimationAndEventsConstants.oppHandLocation, Visibility.Visible);

            // add cards to grids
            grdParent.Children.Add(card.Border);

            moveAnimation = new Animations.MoveAnimation(
                grdParent,
                grdOppMana,
                grdParent,
                null,
                listOppManaZone,
                card,
                AnimationAndEventsConstants.DESTINATIONMANA);
            rotateAnimation        = new RotateAnimation(true, 180);
            rotateAnimation.border = card.Border;
            addEvent(new Event(moveAnimation));
            //addAnimation(rotateAnimation);
        }
        // Start Turn

        private void animateDrawCardOWN(Models.CardWithGameProperties card)
        {
            Models.CardGUIModel      drawnCard;
            Animations.MoveAnimation animation;

            drawnCard = new Models.CardGUIModel(card, this, AnimationAndEventsConstants.ownDeckLocation, Visibility.Hidden);

            // add cards to grids
            grdParent.Children.Add(drawnCard.Border);

            if ((Phase == "Mana phase" || Phase == "Summon phase") && itIsOwnTurn)
            {
                ableToSelect.Add(drawnCard);
            }

            animation = new Animations.MoveAnimation(
                grdParent,
                grdHand,
                grdParent,
                null,
                listHand,
                drawnCard,
                AnimationAndEventsConstants.DESTINATIONOWNHAND);

            animation.startsWithHiddenOrigin = true;
            addEvent(new Event(animation));
        }
        private void animateDeckToMana(Models.CardWithGameProperties card, bool own)
        {
            Models.CardGUIModel      drawnCard;
            Animations.MoveAnimation animation;

            drawnCard = new Models.CardGUIModel(
                card,
                this,
                own == OWN ? AnimationAndEventsConstants.ownDeckLocation : AnimationAndEventsConstants.oppDeckLocation,
                Visibility.Hidden);

            // add cards to grids
            grdParent.Children.Add(drawnCard.Border);

            animation = new Animations.MoveAnimation(
                grdParent,
                own == OWN ? grdOwnMana : grdOppMana,
                grdParent,
                null,
                own == OWN ? listOwnManaZone : listOppManaZone,
                drawnCard,
                AnimationAndEventsConstants.DESTINATIONMANA);

            animation.startsWithHiddenOrigin = true;
            addEvent(new Event(animation));
        }
        private void animateEngageBattleOPP(Models.CardGUIModel cardGUI)
        {
            Animations.RotateAnimation rotateAnimation = new Animations.RotateAnimation(true);

            rotateAnimation.border = cardGUI.Border;
            addEvent(new Event(rotateAnimation));
        }
        private bool checkCanSummon(Models.CardGUIModel card)
        {
            int  count;
            bool found_element;

            count         = 0;
            found_element = false;

            foreach (Models.CardGUIModel cardGUI in listOwnManaZone)
            {
                if (!cardGUI.Card.isEngaged)
                {
                    count += 1;
                }
                if (cardGUI.Card.Element == card.Card.Element)
                {
                    found_element = true;
                }
            }

            if (card.Card.Cost <= count && found_element)
            {
                return(true);
            }
            return(false);
        }
Пример #6
0
        // animate initial conditions

        private void animateOwnSafeguards()
        {
            Models.CardGUIModel safeGuard;

            Thickness margin = new Thickness(5, 0, 0, 0);

            for (int i = 0; i < 5; i++)
            {
                Animations.MoveAnimation animation;

                // add the actual card
                safeGuard = new Models.CardGUIModel(null, this, AnimationConstants.ownDeckLocation, Visibility.Hidden);
                grdParent.Children.Add(safeGuard.Border);

                animation = new Animations.MoveAnimation(grdParent,
                                                         grdOwnSafeguards,
                                                         grdParent,
                                                         null,
                                                         listOwnSafeGuardZone,
                                                         safeGuard,
                                                         AnimationConstants.DESTINATIONSAFEGUARD);
                animation.startsWithHiddenOrigin = true;
                addAnimation(animation);
            }
        }
        public MoveAnimation(
            Grid originGrid, Grid destinationGrid, Grid parentGrid,
            List <Models.CardGUIModel> originList, List <Models.CardGUIModel> destinationList,
            Models.CardGUIModel origin,
            int type,
            bool wasSafeguard = false)
        {
            this.originGrid      = originGrid;
            this.destinationGrid = destinationGrid;
            this.parentGrid      = parentGrid;
            this.originList      = originList;
            this.destinationList = destinationList;
            this.origin          = origin;
            this.type            = type;
            this.wasSafeguard    = wasSafeguard;

            destination            = new Border();
            removeOrigin           = false;
            isFinished             = false;
            isRunning              = false;
            startsWithHiddenOrigin = false;
            speed = DEFAULTSPEED;

            runAnimation          = new DispatcherTimer();
            runAnimation.Interval = new TimeSpan(0, 0, 0, 0, 0);
            runAnimation.Tick    += RunAnimation_Tick;
        }
        private void animateOppSafeguards()
        {
            Models.CardGUIModel safeGuard;

            for (int i = 1; i <= 5; i++)
            {
                Animations.MoveAnimation animation;

                // add the actual card
                safeGuard = new Models.CardGUIModel(null, this, AnimationAndEventsConstants.oppDeckLocation, Visibility.Hidden, i);
                grdParent.Children.Add(safeGuard.Border);

                animation = new Animations.MoveAnimation(
                    grdParent,
                    grdOppSafeguards,
                    grdParent,
                    null,
                    listOppSafeGuardZone,
                    safeGuard,
                    AnimationAndEventsConstants.DESTINATIONSAFEGUARD);
                animation.setSpeed(10);
                animation.startsWithHiddenOrigin = true;
                addEvent(new Event(animation));
            }
        }
Пример #9
0
 public bool isAbleToSelect(Models.CardGUIModel card)
 {
     if (ableToSelect.IndexOf(card) != -1)
     {
         return(true);
     }
     return(false);
 }
Пример #10
0
        private void animateInitialHand()
        {
            Models.CardGUIModel card;

            for (int i = 0; i < 5; i++)
            {
                Animations.MoveAnimation animation;

                card = new Models.CardGUIModel(ctrl.getCardFromInitialHand(), this, AnimationConstants.ownDeckLocation, Visibility.Hidden);
                grdParent.Children.Add(card.Border);

                animation = new Animations.MoveAnimation(
                    grdParent,
                    grdHand,
                    grdParent,
                    null,
                    listHand,
                    card,
                    AnimationConstants.DESTINATIONOWNHAND);
                animation.startsWithHiddenOrigin = true;
                addAnimation(animation);
            }
        }
        private void animateDrawCardOPP()
        {
            Models.CardGUIModel      drawnCard;
            Animations.MoveAnimation animation;

            // set origin and destination
            drawnCard = new Models.CardGUIModel(null, this, AnimationAndEventsConstants.oppDeckLocation, Visibility.Hidden);

            // add cards to grids
            grdParent.Children.Add(drawnCard.Border);

            animation = new Animations.MoveAnimation(
                grdParent,
                grdParent,
                grdParent,
                null,
                null,
                drawnCard,
                AnimationAndEventsConstants.DESTINATIONOPPHAND);

            animation.removeOrigin           = true;
            animation.startsWithHiddenOrigin = true;
            addEvent(new Event(animation));
        }
        private Models.CardGUIModel animateSummonOPP(int cardID)
        {
            Models.CardGUIModel      card;
            Animations.MoveAnimation animation;

            // create origin and destination

            card = new Models.CardGUIModel(ctrl.getCardWithGamePropertiesByID(cardID), this, AnimationAndEventsConstants.oppHandLocation, Visibility.Visible);

            // add cards to grids
            grdParent.Children.Add(card.Border);

            animation = new Animations.MoveAnimation(
                grdParent,
                grdOppBattle,
                grdParent,
                null,
                listOppBattleGround,
                card,
                AnimationAndEventsConstants.DESTINATIONBATTLE);
            addEvent(new Event(animation));

            return(card);
        }
Пример #13
0
 public void removeFromSelectedCards(Models.CardGUIModel card)
 {
     selectedCards.Remove(card);
 }
Пример #14
0
 public void addToSelectedCards(Models.CardGUIModel card)
 {
     selectedCards.Add(card);
 }