Advertisement
Seedx

Untitled

Apr 4th, 2020
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.34 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4.  
  5. namespace zadanie_3._1
  6. {
  7.     class Karty
  8.     {
  9.         public string kolor;
  10.         public string wartosc;
  11.         public List<string> Wartosc = new List<string> { "AS", "2", "3", "4", "5", "6", "7", "8", "9", "10", "Walet", "Dama", "Król" };
  12.  
  13.      
  14.         //     public List<string> Wartosci = {"AS", "2", "3", "4", "5", "6", "7", "8", "9", "10", "Walet", "Dama", "Król"};
  15.         //public string Wartosc
  16.         public enum Kolor {
  17.             karo = 40,
  18.             kier = 60,
  19.             pik = 80,
  20.             trefl = 100
  21.         }
  22.  
  23.         /*public enum Wartość
  24.         {
  25.             AS = 1, Król, Dama, Walet, a10, a9, a8, a7, a6, a5, a4, a3, a2
  26.         }*/
  27.        
  28.        
  29.        
  30.         public Karty(int x, int y)
  31.         {
  32.            
  33.             this.kolor = Enum.GetName(typeof(Kolor), x);
  34.             this.wartosc = this.Wartosc[y];  
  35.            
  36.             /*if (y > 4)
  37.             {
  38.                 for (int i = 1; i < Enum.GetName(typeof(Wartość), y).Length; i++)
  39.                 {
  40.                     this.wartosc += ((Enum.GetName(typeof(Wartość), y))[i]);
  41.                 }
  42.             }
  43.             else
  44.             {
  45.             this.wartosc = Enum.GetName(typeof(Wartość), y);
  46.             }*/
  47.         }
  48.     }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement