-
Notifications
You must be signed in to change notification settings - Fork 1
/
Evil.java
52 lines (44 loc) · 959 Bytes
/
Evil.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
/*
* This is the Evil class for Test_Game.
* Evil is created by Controller. Very similar to Player (might be good for inheritance).
* @author gliebchen
* @version 1.0
* @since 2016-03-16
*/
public class Evil {
private int rowCoord;
private int colCoord;
private char appearance;
private boolean dead;
public Evil(int r, int c){
intialiseEvil(r,c);
}
private void intialiseEvil(int r, int c){
appearance = 'x';
rowCoord = r;
colCoord = c;
dead = false;
}
public int[] suggestMove(){
int [] location = {rowCoord,colCoord};
location[1] = colCoord-1;
return location;
}
public char getAppearance(){
return appearance;
}
public void setLocation(int[] location){
rowCoord=location[0];
colCoord=location[1];
}
public int[] getLocation(){
int[] location = {rowCoord,colCoord};
return location;
}
public boolean isDead(){
return dead;
}
public void setDead(boolean death){
dead = death;
}
}