public override bool Equals(Object obj)
 {
     if ((obj == null) || !this.GetType().Equals(obj.GetType()))
     {
         return(false);
     }
     else
     {
         CardBusinessLogic compared = (CardBusinessLogic)obj;
         return((this.Suit == compared.Suit) && (this.Rank == compared.Rank));
     }
 }
Beispiel #2
0
        private string[] GetCardsForDisplay(Hand handToDisplay, ICardMapper cardMapper, ICardMapperForUI cardMapperForUI)
        {
            int[] cardsInHand = handToDisplay.GetAllCards();
            CardBusinessLogic[] cardsForBusinessLogic = new CardBusinessLogic[cardsInHand.Length];
            for (int i = 0; i < cardsInHand.Length; i++)
            {
                cardsForBusinessLogic[i] = cardMapper.MapCard(cardsInHand[i]);
            }

            string[] cardsForDisplay = new string[cardsForBusinessLogic.Length];
            for (int i = 0; i < cardsForBusinessLogic.Length; i++)
            {
                cardsForDisplay[i] = cardMapperForUI.GetCardForUI(cardsForBusinessLogic[i]);
            }

            return(cardsForDisplay);
        }