-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMove.java
More file actions
65 lines (58 loc) · 1.32 KB
/
Move.java
File metadata and controls
65 lines (58 loc) · 1.32 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
54
55
56
57
58
59
60
61
62
63
64
65
public class Move
{
private Player player;
private int xCoord;
private int yCoord;
/**
* Constructor for a Move.
* @param p The Player whose move this is.
* @param x Represents the x value of the Peg the player wants to place their bead on.
* @param y Represents the y value of the Peg the player wants to place their bead on.
*/
public Move(Player p, int x, int y)
{
player = p;
xCoord = x;
yCoord = y;
}
/**
* Get the x coordinate for this Move.
*/
public int getXCoord() {
return xCoord;
}
/**
* Get the y coordinate for this Move.
*/
public int getYCoord() {
return yCoord;
}
/**
* Set the x coordinate for this Move.
*/
public void setXCoord(int x) {
xCoord = x;
}
/**
* Set the x coordinate for this Move.
*/
public void setYCoord(int y) {
yCoord = y;
}
/**
* Gets the Player this Move is associated with.
* @return Returns the Player the Move is associated with.
*/
public Player getPlayer()
{
return player;
}
/**
* Changes the Player this Move is associated with.
* @param p The player who we wish to set the Move to.
*/
public void setPlayer(Player p)
{
player = p;
}
}