-
Notifications
You must be signed in to change notification settings - Fork 0
/
Car.java
141 lines (116 loc) · 2.5 KB
/
Car.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
public class Car {
private int x;
private int y;
private int endX;
private int endY;
private int length;
private boolean isPlayer;
private boolean isMoveable;
private int carSkin;
private int moveCount;
private int carDirection;
private String imageLocation;
public Car(){
isMoveable = false;
length = 1;
isPlayer = false;
}
public Car(int x, int y, int length, boolean isPlayer, boolean isMoveable, int carSkin) {
this.x = x;
this.y = y;
this.length = length;
this.isPlayer = isPlayer;
this.isMoveable = isMoveable;
this.carSkin = carSkin;
}
public Car clone() {
Car newCar = new Car();
newCar.x = x;
newCar.y = y;
newCar.endX = endX;
newCar.endY = endY;
newCar.length = length;
newCar.isPlayer = isPlayer;
newCar.isMoveable = isMoveable;
newCar.carSkin = carSkin;
newCar.moveCount = moveCount;
newCar.carDirection = carDirection;
newCar.imageLocation = imageLocation;
return newCar;
}
public void setCarDirection(int dir){
this.carDirection = dir;
}
public int getCarDirection(){
return carDirection;
}
public void move(int x, int y) { //MOVES TO DO PARAMETERS
this.x = x;
this.y = y;
}
public void changeCarSkin(int skinNumber) {
//TO DO
}
public int getX() {
return x;
}
public void setX(int x) {
this.x = x;
}
public int getY() {
return y;
}
public void setY(int y) {
this.y = y;
}
public int getLength() {
return length;
}
public void setLength(int length) {
this.length = length;
}
public boolean isPlayer() {
return isPlayer;
}
public void setPlayer(boolean isPlayer) {
this.isPlayer = isPlayer;
}
public boolean isMoveable() {
return isMoveable;
}
public void setMoveable(boolean isMoveable) {
this.isMoveable = isMoveable;
}
public int getCarSkin() {
return carSkin;
}
public void setCarSkin(int carSkin) {
this.carSkin = carSkin;
}
public int getMoveCount() {
return moveCount;
}
public void setMoveCount(int moveCount) {
this.moveCount = moveCount;
}
public void setImageLocation(String loc){
imageLocation = loc;
}
public String getImageLocation(){
return imageLocation;
}
public void setHorizontalX(int x, int endX) {
this.x = x;
this.endX = endX;
}
public int getVerticalY() {
return endY;
}
public void setVerticalY(int y, int endY) {
this.y = y;
this.endY = endY;
}
public int getHorizontalX() {
return endX;
}
}