Example #1
0
        private async Task PrepareToAnimateAsync(AnimateCardInPileEventModel <CA> data) // don't need index ever for this.
        {
            var topLocation   = GetStartLocation();
            var bottomLocaton = GetBottomLocation();

            switch (data.Direction)
            {
            case EnumAnimcationDirection.StartCardToDown:
            {
                _animates !.LocationFrom = _objectLocation;
                _animates.LocationTo     = bottomLocaton;
                break;
            }

            case EnumAnimcationDirection.StartCardToUp:
            {
                _animates !.LocationFrom = _objectLocation;
                _animates.LocationTo     = topLocation;
                break;
            }

            case EnumAnimcationDirection.StartDownToCard:
            {
                _animates !.LocationFrom = bottomLocaton;
                _animates.LocationTo     = _objectLocation;
                break;
            }

            case EnumAnimcationDirection.StartUpToCard:
            {
                _animates !.LocationFrom = topLocation;
                _animates.LocationTo     = _objectLocation;
                break;
            }
            }
            GW thisControl = new GW();

            thisControl.SendSize(_tagUsed, data.ThisCard !);
            thisControl.Drew       = false;                // has to be after the sendsize everytime.
            thisControl.IsSelected = false;                // not seleccted either regardless.
            await _animates !.DoAnimateAsync(thisControl); // i think

            if (data.FinalAction != null)
            {
                data.FinalAction.Invoke();
            }
            thisControl.IsVisible = false;
            _thisCanvas !.Children.Clear(); //try this too.
        }
Example #2
0
        private async Task PrepareToAnimateAsync(AnimateCardInPileEventModel <FlinchCardInformation> data) // don't need index ever for this.
        {
            var thisPile      = FindControl(data.ThisPile !);
            var topLocation   = GetStartLocation();
            var bottomLocaton = GetBottomLocation();
            var cardLocation  = GetCardLocation(thisPile !);

            switch (data.Direction)
            {
            case EnumAnimcationDirection.StartCardToDown:
            {
                _animates !.LocationFrom = cardLocation;
                _animates.LocationTo     = bottomLocaton;
                break;
            }

            case EnumAnimcationDirection.StartCardToUp:
            {
                _animates !.LocationFrom = cardLocation;
                _animates.LocationTo     = topLocation;
                break;
            }

            case EnumAnimcationDirection.StartDownToCard:
            {
                _animates !.LocationFrom = bottomLocaton;
                _animates.LocationTo     = cardLocation;
                break;
            }

            case EnumAnimcationDirection.StartUpToCard:
            {
                _animates !.LocationFrom = topLocation;
                _animates.LocationTo     = cardLocation;
                break;
            }
            }
            CardGraphicsXF thisControl = new CardGraphicsXF();

            thisControl.SendSize("", data.ThisCard !);
            thisControl.Drew       = false;
            thisControl.IsSelected = false;
            thisControl.DoInvalidate();
            await _animates !.DoAnimateAsync(thisControl); // i think

            thisControl.IsVisible = false;
            _thisCanvas !.Children.Clear(); //try this too.
        }
Example #3
0
        private async Task PrepareToAnimateAsync(AnimateCardInPileEventModel <CA> data) // don't need index ever for this.
        {
            var thisPile       = FindControl(data.ThisPile !);
            var topLocation    = GetStartLocation(thisPile);
            var bottomLocaton  = GetBottomLocation(thisPile);
            var objectLocation = GetObjectLocation(thisPile);

            switch (data.Direction)
            {
            case EnumAnimcationDirection.StartCardToDown:
            {
                _animates !.LocationFrom = objectLocation;
                _animates.LocationTo     = bottomLocaton;
                break;
            }

            case EnumAnimcationDirection.StartCardToUp:
            {
                _animates !.LocationFrom = objectLocation;
                _animates.LocationTo     = topLocation;
                break;
            }

            case EnumAnimcationDirection.StartDownToCard:
            {
                _animates !.LocationFrom = bottomLocaton;
                _animates.LocationTo     = objectLocation;
                break;
            }

            case EnumAnimcationDirection.StartUpToCard:
            {
                _animates !.LocationFrom = topLocation;
                _animates.LocationTo     = objectLocation;
                break;
            }
            }
            GW thisControl = new GW();

            thisControl.SendSize(_tagUsed, data.ThisCard !);
            thisControl.Drew       = false;
            thisControl.IsSelected = false; // not seleccted either regardless.
            await _animates !.DoAnimateAsync(thisControl);
        }
        private async Task PrepareToAnimateAsync(AnimateCardInPileEventModel <CA> data) // don't need index ever for this.
        {
            var topLocation   = GetStartLocation();
            var bottomLocaton = GetBottomLocation();

            switch (data.Direction)
            {
            case EnumAnimcationDirection.StartCardToDown:
            {
                _animates !.LocationFrom = _objectLocation;
                _animates.LocationTo     = bottomLocaton;
                break;
            }

            case EnumAnimcationDirection.StartCardToUp:
            {
                _animates !.LocationFrom = _objectLocation;
                _animates.LocationTo     = topLocation;
                break;
            }

            case EnumAnimcationDirection.StartDownToCard:
            {
                _animates !.LocationFrom = bottomLocaton;
                _animates.LocationTo     = _objectLocation;
                break;
            }

            case EnumAnimcationDirection.StartUpToCard:
            {
                _animates !.LocationFrom = topLocation;
                _animates.LocationTo     = _objectLocation;
                break;
            }
            }
            GW thisControl = new GW();

            thisControl.SendSize(_tagUsed, data.ThisCard !);
            if (_thisMod !.DeckStyle == DeckObservablePile <CA> .EnumStyleType.Unknown)
            {
                thisControl.IsUnknown = true;
            }
Example #5
0
 public async Task HandleAsync(AnimateCardInPileEventModel <CA> message)
 {
     await PrepareToAnimateAsync(message);
 }
Example #6
0
 public async Task HandleAsync(AnimateCardInPileEventModel <FlinchCardInformation> message)
 {
     await PrepareToAnimateAsync(message);
 }