-
Notifications
You must be signed in to change notification settings - Fork 0
/
Obelisk.java
71 lines (65 loc) · 1.9 KB
/
Obelisk.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
71
/**
* Class for the Pharaoh unit in the game khet
*
* @author CSIS225 Team 3
*/
class Obelisk extends GamePiece{
protected boolean stacked;
/**
* Basic constructor for the Obelisk class
*/
public Obelisk(){
name = "Obelisk";
team = "neutral";
stacked = false;
direction = 0;
}
/**
* Basic constructor for the Obelisk class
*
* @param team The name of the team that the piece belongs to
* @param direction The initial direction the piece will be facing
*/
public Obelisk(String team, int direction){
this();
this.team = team;
this.direction = direction;
}
/**
* Basic constructor for the Obelisk class
*
* @param team The name of the team that the piece belongs to
* @param direction The initial direction the piece will be facing
* @param stacked indicates if the obelisk is stakced with another obelisk
*/
public Obelisk(String team, int direction, boolean stacked){
this();
this.team = team;
this.direction = direction;
this.stacked = stacked;
}
/**
* Method to get the directory path of an image that represents the
* GamePeice
*
* @return a string that represents the path of the image relative to
* the working directory
*/
public String getImage(){
if(stacked)
return image+team+name+direction+"Stacked.png";
else
return image+team+name+direction+".png";
}
/**
* Method to find how the GamePeice affects the laser
*
* @param laserDirection the direction the laser is moving prior to
* entering the GamePeice
* @return the direction of the laser when exiting the game peice
* returns -1 if the gmaePeice is destroyed by the laser
*/
public int getNewDirection(int laserDirection){
return -1;
}
}