Example #1
0
        /// <summary>
        ///  关闭奖单
        /// </summary>
        /// <param name="poid">奖单Id</param>
        /// <param name="state">奖单状态</param>
        public OperationResult UpdateLotteryState(Guid poid, RevealState state)
        {
            PrizeOrder entity = PrizeOrderRepository.Entities.Where(lr => lr.Id == poid).FirstOrDefault();

            if (entity == null)
            {
                return(new OperationResult(OperationResultType.Warning, string.Format("没有Id为{0}的中奖信息。", poid.ToString()), poid.ToString()));
            }

            if (state == entity.RevealState)
            {
                return(new OperationResult(OperationResultType.Warning, "要更新的状态与数据库的一致,无需更改。", entity));
            }

            entity.RevealState = state;

            int rcount = PrizeOrderRepository.Update(entity);

            if (rcount > 0)
            {
                return(new OperationResult(OperationResultType.Success, "更新状态成功。", entity));
            }
            else
            {
                return(new OperationResult(OperationResultType.Warning, "更新状态失败。"));
            }
        }
Example #2
0
        public void StartHidingAnimation()
        {
            _state = RevealState.Hiding;

            _childViewImage = GetChildViewImage();
            _rootLayout.Children.Add(_canvasView);
            ChildView.Opacity = 0.0;

            var hideAnimation = new Animation(
                interpolatedValue =>
            {
                _revealProgress = (float)interpolatedValue;
                _canvasView.InvalidateSurface();
            },
                start: 1.0,
                end: 0.0,
                easing: RevealEasing
                );

            hideAnimation.Commit(this, "HideAnimation", length: Convert.ToUInt32(RevealDurationMillis), finished: (d, b) =>
            {
                _state = RevealState.Hidden;
                _rootLayout.Children.Remove(_canvasView);
            });
        }
Example #3
0
    /* Shows the number of specified cards in a simple row / column box pattern
     */
    void GoToShowing(int numWildcards)
    {
        // Spawn all the wildcards
        int   numCardsToDeal = numWildcards;
        int   rowCount       = 0;
        float numRows        = Mathf.Ceil((float)numWildcards / numCardsPerRow);
        float initialZOffset = ((numRows - 1) / 2.0f) * (CARD_WIDTH + padding);

        while (numCardsToDeal > 0)
        {
            int cardsThisRow = Mathf.Min(numCardsToDeal, numCardsPerRow);
            // Get the initial xOffset for the row based on how many we will have to deal
            float initialXOffset = -((cardsThisRow - 1) / 2.0f) * (CARD_WIDTH + padding);
            int   colCount       = 0;
            while (colCount < cardsThisRow)
            {
                float xOffset = colCount * (CARD_WIDTH + padding);
                float zOffset = -rowCount * (CARD_WIDTH + padding);
                // Spawn the card
                SpawnWildcard(initialXOffset + xOffset, initialZOffset + zOffset);
                numCardsToDeal--;
                colCount++;
            }
            rowCount++;
        }

        state = RevealState.Showing;
        allCardAreRevealed = false;
        nextCardToAnimate  = 0;
        timeStateEntered   = Time.time;

        AssignItems();
    }
Example #4
0
        public void StartRevealAnimation()
        {
            _state = RevealState.Revealing;

            ChildView.Opacity = 0.0;

            //_childViewImage = _childViewImage ?? GetChildViewImage();
            _childViewImage = GetChildViewImage();
            _rootLayout.Children.Add(_canvasView);

            var revealAnimation = new Animation(
                interpolatedValue =>
            {
                _revealProgress = (float)interpolatedValue;
                _canvasView.InvalidateSurface();
            },
                easing: RevealEasing
                );

            revealAnimation.Commit(this, "RevealAnimation", length: Convert.ToUInt32(RevealDurationMillis), finished: (d, b) =>
            {
                _state            = RevealState.Revealed;
                ChildView.Opacity = 1.0;
                _rootLayout.Children.Remove(_canvasView);
            });
        }
Example #5
0
    /*
     * Puts the Revealer into the state where it hides cards one by one.
     */
    void GoToHiding()
    {
        state             = RevealState.Hiding;
        nextCardToAnimate = 0;
        timeStateEntered  = Time.time;

        // Hide all the cards at once
        while (nextCardToAnimate < transform.childCount)
        {
            HideCard(nextCardToAnimate);
            nextCardToAnimate++;
        }
    }
Example #6
0
        public ViewRevealer()
        {
            // dependency service that creates a bitmap from a XF.View:
            // https://forums.xamarin.com/discussion/75408/is-it-possible-to-create-an-image-from-a-view-in-xamarin-forms
            // https://michaelridland.com/xamarin/creating-native-view-xamarin-forms-viewpage/

            // create an SKBitmap or better with that

            // reveal result in canvas

            // when done hide the canvas and show the childView

            this.BackgroundColor = Color.Transparent;
            _state = RevealState.Hidden;
            //ToDo: make InputTransparent while NOT Revealed
        }
Example #7
0
 /*
  * Ends the Reveal
  */
 void GoToFinish()
 {
     AwardItems();
     state = RevealState.Finish;
     Destroy(gameObject);
 }
Example #8
0
 /*
  * Puts the Revealer into the state where it shows the card backs
  */
 void GoToIdle()
 {
     state             = RevealState.Idle;
     nextCardToAnimate = 0;
     timeStateEntered  = Time.time;
 }
Example #9
0
 /*
  * Puts the Revealer into the state where it reveals cards one by one.
  */
 void GoToRevealing()
 {
     state             = RevealState.Revealing;
     nextCardToAnimate = 0;
     timeStateEntered  = Time.time;
 }
    /* Shows the number of specified cards in a simple row / column box pattern
     */
    void GoToShowing(int numWildcards)
    {
        // Spawn all the wildcards
        int numCardsToDeal = numWildcards;
        int rowCount = 0;
        float numRows = Mathf.Ceil ((float)numWildcards / numCardsPerRow);
        float initialZOffset = ((numRows - 1) / 2.0f) * (CARD_WIDTH + padding);
        while (numCardsToDeal > 0) {
            int cardsThisRow = Mathf.Min (numCardsToDeal, numCardsPerRow);
            // Get the initial xOffset for the row based on how many we will have to deal
            float initialXOffset = -((cardsThisRow - 1) / 2.0f) * (CARD_WIDTH + padding);
            int colCount = 0;
            while (colCount < cardsThisRow) {
                float xOffset = colCount * (CARD_WIDTH + padding);
                float zOffset = -rowCount * (CARD_WIDTH + padding);
                // Spawn the card
                SpawnWildcard (initialXOffset + xOffset, initialZOffset + zOffset);
                numCardsToDeal--;
                colCount++;
            }
            rowCount++;
        }

        state = RevealState.Showing;
        allCardAreRevealed = false;
        nextCardToAnimate = 0;
        timeStateEntered = Time.time;

        AssignItems ();
    }
 /*
  * Puts the Revealer into the state where it reveals cards one by one.
  */
 void GoToRevealing()
 {
     state = RevealState.Revealing;
     nextCardToAnimate = 0;
     timeStateEntered = Time.time;
 }
 /*
  * Puts the Revealer into the state where it shows the card backs
  */
 void GoToIdle()
 {
     state = RevealState.Idle;
     nextCardToAnimate = 0;
     timeStateEntered = Time.time;
 }
    /*
     * Puts the Revealer into the state where it hides cards one by one.
     */
    void GoToHiding()
    {
        state = RevealState.Hiding;
        nextCardToAnimate = 0;
        timeStateEntered = Time.time;

        // Hide all the cards at once
        while (nextCardToAnimate < transform.childCount) {
            HideCard (nextCardToAnimate);
            nextCardToAnimate++;
        }
    }
 /*
  * Ends the Reveal
  */
 void GoToFinish()
 {
     AwardItems ();
     state = RevealState.Finish;
     Destroy (gameObject);
 }