示例#1
0
 private DisplayCard convertCardToDisplayCard(Card oldcard, decimal odds)
 {
     DisplayCard newCard = new DisplayCard(oldcard.cardName, oldcard.cardLevel);
       newCard.OddsToDrawSpecificCard = Convert.ToString(odds);
       return newCard;
 }
示例#2
0
        private void ColorCurrentStack(DataGrid grid, DisplayCard selectedCard)
        {
            Color colorRed = (Color)ColorConverter.ConvertFromString("#B12D1C");
              Color colorOrange = (Color)ColorConverter.ConvertFromString("#FEA772");
              Color colorGreen = (Color)ColorConverter.ConvertFromString("#75C14F");
              IEnumerable<DataGridRow> rows = GetDataGridRows(grid);

              foreach (DataGridRow r in rows)
              {
            DisplayCard comparedCard;
            comparedCard = (DisplayCard)r.Item;
            int fight = selectedCard.SimulateFight(comparedCard);
            if (fight == 2)
            {
              r.Background = new SolidColorBrush(colorRed);
            }
            if (fight == 0)
            {
              r.Background = new SolidColorBrush(colorOrange);
            }
            if (fight == 1)
            {
              r.Background = new SolidColorBrush(colorGreen);
            }
              }
        }