-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeadManager.java
38 lines (38 loc) · 949 Bytes
/
deadManager.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
import java.util.*;
import java.awt.*;
public class deadManager
{
static ArrayList<Point> lox=new ArrayList<>();
static int stackbottom,stacktop;
public static void initlox()
{
for(int i=420;i<620;i+=40)
{
for(int j=680;j<=game.getChessBoard().pan.getWidth()+540;j+=40)
{
lox.add(new Point(j,i));
}
}
stackbottom=0;
stacktop=lox.size()-1;
if(lox.size()-1<32)
System.out.println("Logical error");
}
public static Point getFreeLocation(goti g)
{
if(stacktop<stackbottom)
Environment.log("deadManager error");
Point ret=null;
if(g.teamCol.equals(game.getHerePlayer().getColor()))
{
ret=lox.get(stacktop);
stacktop--;
}
else
{
ret=lox.get(stackbottom);
stackbottom++;
}
return ret;
}
}