/// <summary>
 /// Draw this <see cref="CardMovementAnimation"/>.
 /// </summary>
 public void Draw(SpriteBatch spriteBatch)
 {
     if (LerpInformation == null)
     {
         return;
     }
     Card.Draw(spriteBatch);
 }
Example #2
0
        /// <summary>
        /// Draw this <see cref="TableauPile"/>.
        /// </summary>
        public void Draw(SpriteBatch spriteBatch)
        {
            GameplayScreen gameplayScreen = MainGame.Context.GameScreenManager.Get <GameplayScreen>();

            for (int j = 0; j < Count; j++)
            {
                Card  card       = this[j];
                float layerDepth = j / (float)(Count + 100);

                bool isPileSelected = gameplayScreen.CurrentSelection?.CardPile == this;
                bool isPortionCard  = SelectedPortion != null && SelectedPortion.Contains(card) && isPileSelected;

                // If this card is part of a portion that extends to the top of the pile, make it glow!
                // (i.e. if the portion contains the top card, it extends to the top. This is guaranteed to work
                // since a portion is a continuous subset of the pile.)
                bool isGlowing = isPortionCard && SelectedPortion.Contains(Peek());

                // The card is grayed out if it is not selected BUT this tableau pile IS selected AND it isn't part of a portion.
                bool isGrayedOut = isPileSelected && !isPortionCard;

                card.Draw(spriteBatch, layerDepth, isGlowing, layerDepth + 0.01f, isGrayedOut);
            }
        }