-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlayer.java
More file actions
71 lines (39 loc) · 858 Bytes
/
Player.java
File metadata and controls
71 lines (39 loc) · 858 Bytes
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
package Auto120;
public class Player {
//properties
int p_playerid;
Marker[] p_pieces = new Marker[5];
public Player() {
//default empty constructor
}
public Player(int x_id)
{
int x_counter = 0;
p_playerid = x_id;
for (x_counter = 1; x_counter <= 4; x_counter++)
{
p_pieces[x_counter] = new Marker(x_id);
}
}
public Marker p_assignpiece(int x_player)
{
Marker x_marker = new Marker(x_player);
return x_marker;
}
public int p_get_playerid()
{
return p_playerid;
}
public boolean p_check_game_status(Player x_player) {
int x_counter = 0;
boolean x_game_over = true;
for (x_counter = 1; x_counter <= 4; x_counter++)
{
if (x_player.p_pieces[x_counter].m_get_location() != 120)
{
x_game_over = false;
}
}
return x_game_over;
}
}