-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPlayer.cs
40 lines (38 loc) · 921 Bytes
/
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
using clases;
using System;
using System.Collections.Generic;
using System.Text;
namespace Juego_POO
{
class Player
{
Dealer a;
Card b;
List<Card> hand = new List<Card>();
public List<Card> Hand
{
get { return hand; }
set { hand = value; }
}
public List<Card> Deal(List<Card> deck)
{
a = new Dealer();
int b = deck.Count;
List<Card> lastCard = new List<Card>();
lastCard.Add(deck[b - 1]);
deck.RemoveAt(b - 1);
return lastCard;
}
public void AddCard(List<Card> card)
{
hand.Add(card[0]);
}
public void Init(List<Card> deck)
{
var lastcard = Deal(deck);
AddCard(lastcard);
var lastcard2 = Deal(deck);
AddCard(lastcard2);
}
}
}