-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGameTable.cs
More file actions
53 lines (46 loc) · 1.04 KB
/
Copy pathGameTable.cs
File metadata and controls
53 lines (46 loc) · 1.04 KB
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
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarlosSeptica
{
public class GameTable : Clonable
{
public List<Card> Cards
{
get;
}
public Player HandOwner
{
get;
set;
}
public GameTable()
{
Cards = new List<Card>();
}
public void Draw(Graphics g, int x, int y)
{
// Draw cards on the table
for (int i = 0; i < Cards.Count; ++i)
{
Cards[i].Draw(g, x + i*35, y, false);
}
}
/**
* Clones current object
* Remember to set hand owner after you clone this
*/
public Clonable Clone()
{
GameTable clone = new GameTable();
foreach(Card c in Cards)
{
clone.Cards.Add((Card)c.Clone());
}
return clone;
}
}
}