-
Notifications
You must be signed in to change notification settings - Fork 1
/
Move.java
42 lines (34 loc) · 943 Bytes
/
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
package strategy.model;
import message.Direction;
/**
* Класс для описания маршрута движения бота. Использовался в начальных версиях стратегии.
* @see strategy.SimpleStrategy
* @see MovePlanWithScore
*/
public class Move {
// Направление движения
private Direction direction;
//Сколько клеток двигаться в направлении direction
private int length;
public Move(Direction direction) {
this.direction = direction;
this.length = Integer.MAX_VALUE;
}
public Move(Direction direction, int length) {
this.direction = direction;
this.length = length;
}
public Direction getDirection() {
return direction;
}
public int getLength() {
return length;
}
@Override
public String toString() {
return "" + direction + "(" + length + ")";
}
public void setLength(int n) {
length = n;
}
}