-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIndicator.java
More file actions
54 lines (40 loc) · 1.53 KB
/
Copy pathIndicator.java
File metadata and controls
54 lines (40 loc) · 1.53 KB
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
package Modular;
import Data.Data;
import Util.Util;
import java.awt.*;
public class Indicator {
public static void drawIndicator(Graphics g) {
drawIndicatorUser(g);
drawIndicatorAI(g);
}
public static void drawIndicatorUser(Graphics g1) {
int x = Util.getPointerAtChessboard().x * 40 + 60;
int y = Util.getPointerAtChessboard().y * 40 + 60;
g1.setColor(Color.red);
Graphics2D g = (Graphics2D) g1;
g.setStroke(new BasicStroke(1.2f));
g.drawLine(x - 15, y - 15, x - 5, y - 15);
g.drawLine(x - 15, y - 15, x - 15, y - 5);
g.drawLine(x + 15, y - 15, x + 5, y - 15);
g.drawLine(x + 15, y - 15, x + 15, y - 5);
g.drawLine(x - 15, y + 15, x - 15, y + 5);
g.drawLine(x - 15, y + 15, x - 5, y + 15);
g.drawLine(x + 15, y + 15, x + 15, y + 5);
g.drawLine(x + 15, y + 15, x + 5, y + 15);
}
public static void drawIndicatorAI(Graphics g) {
if (Data.pattern == 1 && Data.chessArray.size() > 1) {
if (Data.lastChessPositionAIX == -1 && Data.lastChessPositionAIY == -1) {
return;
}
int x = Data.lastChessPositionAIX;
int y = Data.lastChessPositionAIY;
x = Data.chessArray.get(Data.chessArray.size() - 1).row;
y = Data.chessArray.get(Data.chessArray.size() - 1).column;
x = x * 40 - 24;
y = y * 40 - 24;
g.setColor(Color.red);
g.fillArc(x + 40, y + 40, 8, 8, 0, 360);
}
}
}