-
Notifications
You must be signed in to change notification settings - Fork 2
/
Move.java
70 lines (64 loc) · 1.79 KB
/
Move.java
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
/**
* Move is used as a structure to store a single Move
*
* @author gcschmit
* @version 24 January 2020
*/
public class Move
{
private int x;
private int y;
private Piece piece;
private double score;
/**
* Constructs a new Move object
*
* @param initialX the desired x coordinate of the bottom-left corner of the piece
* @param initialY the desired y coordinate of the bottom-left corner of the piece
* @param initialPiece the desired orientation (rotation) of the piece
* @param initialScore the score of this move (lower scores are better)
*/
public Move(int initialX, int initialY, Piece initialPiece, double initialScore)
{
this.x = initialX;
this.y = initialY;
this.piece = initialPiece;
this.score = initialScore;
}
/**
* Returns the desired x coordinate of the bottom-left corner of the piece for this move
*
* @return the desired x coordinate of the bottom-left corner of the piece for this move
*/
public int getX()
{
return this.x;
}
/**
* Returns the desired y coordinate of the bottom-left corner of the piece for this move
*
* @return the desired y coordinate of the bottom-left corner of the piece for this move
*/
public int getY()
{
return this.y;
}
/**
* Returns the desired orientation (rotation) of the piece for this move
*
* @return the desired orientation (rotation) of the piece for this move
*/
public Piece getPiece()
{
return this.piece;
}
/**
* Returns the score of this move (lower scores are better)
*
* @return the score of this move
*/
public double getScore()
{
return this.score;
}
}