-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCard.cs
76 lines (70 loc) · 1.63 KB
/
Card.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
using System;
using System.Collections.Generic;
using System.DirectoryServices.ActiveDirectory;
using System.Text;
namespace clases
{
class Card
{
string suit;
string symbol;
int score;
string color;
public Card(string suit, string symbol)
{
this.suit = suit;
this.symbol = symbol;
if (suit == "♦" || suit == "♥")
{
color = "Red";
}
else
{
if (suit == "♣" || suit == "♠")
{
color = "Black";
}
}
if (symbol == "A")
{
score = 1;
}
else
{
if (symbol == "J" || symbol == "Q" || symbol == "K")
{
score = 10;
}
else
{
int valueCard = Convert.ToInt32(symbol);
score = valueCard;
}
}
}
public string Suit
{
get { return suit; }
set { suit = value; }
}
public string Symbol
{
get { return symbol; }
set { symbol = value; }
}
public int Score
{
get { return score; }
set { score = value; }
}
public string Color
{
get { return color; }
set { color = value; }
}
public string ShowIn()
{
return "Card: " + symbol + suit + " " + color ;
}
}
}