forked from guitared/AssignHiLowCardGameUML
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Player.cs
65 lines (56 loc) · 1.34 KB
/
Player.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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Card
{
class Player : Form1
{
private string name;
private List<ACard> deck = new List<ACard>();
private List<ACard> pile = new List<ACard>();
//Return current deck
public List<ACard> getDeck()
{
return deck;
}
//Get new deck
public void inDeck(List<ACard> indeck)
{
deck = indeck;
}
//Return current amount of cards in deck
public int getNumdeck()
{
return deck.Count;
}
//Return current amount of cards in pile
public int getNumpile()
{
return pile.Count;
}
//New Player
public Player(string namein)
{
name = namein;
}
//Draw Top card from deck
public ACard getCard()
{
ACard tmp = deck[getNumdeck()-1];
deck.RemoveAt(getNumdeck()-1);
return tmp;
}
//Put card at Top of pile
public void addPile(ACard cardin)
{
pile.Add(cardin);
}
//Put card at Top of deck
public void addDeck(ACard cardin)
{
deck.Add(cardin);
}
}
}