-
Notifications
You must be signed in to change notification settings - Fork 0
/
Card.cs
77 lines (63 loc) · 1.52 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
77
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BlackJack
{
/// <summary>
/// A playing card
/// </summary>
public class Card
{
#region Fields
string rank;
string suit;
bool faceUp;
#endregion
#region Constructors
/// <summary>
/// Constructs a card with the given rank and suit
/// </summary>
/// <param name="rank">the rank</param>
/// <param name="suit">the suit</param>
public Card(string rank, string suit)
{
this.rank = rank;
this.suit = suit;
faceUp = false;
}
#endregion
#region Properties
/// <summary>
/// Gets the card rank
/// </summary>
public string Rank
{
get { return rank; }
}
/// <summary>
/// Gets the card suit
/// </summary>
public string Suit
{
get { return suit; }
}
/// <summary>
/// Gets whether or not the card is face up
/// </summary>
public bool FaceUp
{
get { return faceUp; }
}
#endregion
#region Public methods
/// <summary>
/// Flips the card over
/// </summary>
public void FlipOver()
{
faceUp = !faceUp;
}
#endregion
}
}