예제 #1
0
        /// <summary>
        /// Referido as cartas normais
        /// </summary>
        /// <param name="foldercolor"></param>
        /// <param name="cardNumber"></param>
        /// <param name="cardcolor"></param>
        private Carta CreateCard(string foldercolor, string cardNumber, string cardcolor)
        {
            ImageBrush brush;

            try { brush = new ImageBrush(new BitmapImage(new Uri("pack://application:,,,/MauMau;component/Images/Cartas/" + foldercolor + "/" + cardNumber + cardcolor + ".jpg", UriKind.Absolute))); }
            catch { brush = new ImageBrush(new BitmapImage(new Uri("pack://application:,,,/MauMau;component/Images/Cartas/" + foldercolor + "/" + cardNumber + cardcolor + ".png", UriKind.Absolute))); }

            return(new Normal(PaletaCor.GetCor(foldercolor), int.Parse(cardNumber), brush, (cardcolor + cardNumber)));
        }
예제 #2
0
        /// <summary>
        /// Cria as cartas especiais de uma cor
        /// </summary>
        /// <param name="foldercolor"></param>
        /// <param name="cardcolor"></param>
        private Carta CreateCardSpecial(string foldercolor, string cardcolor, string cardname, int numCard)
        {
            ImageBrush brush;

            try { brush = new ImageBrush(new BitmapImage(new Uri("pack://application:,,,/MauMau;component/Images/Cartas/" + foldercolor + "/" + cardcolor + cardname + ".jpg", UriKind.Absolute))); }
            catch { brush = new ImageBrush(new BitmapImage(new Uri("pack://application:,,,/MauMau;component/Images/Cartas/" + foldercolor + "/" + cardcolor + cardname + ".png", UriKind.Absolute))); }

            Efeito efeitoaux;

            if (cardname.ToUpper() == "BLOQ")
            {
                efeitoaux = Efeito.Bloquear;
            }
            else if (cardname.ToUpper() == "COMPRA")
            {
                efeitoaux = Efeito.Comprar2;
            }
            else
            {
                efeitoaux = Efeito.Inverter;
            }

            return(new Especial(efeitoaux, brush, PaletaCor.GetCor(foldercolor), (cardname + cardcolor + numCard)));
        }