forked from phu004/JavaRTS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtokenObject.java
More file actions
50 lines (31 loc) · 1.03 KB
/
Copy pathtokenObject.java
File metadata and controls
50 lines (31 loc) · 1.03 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
package entity;
import core.Rect;
import core.mainThread;
import core.postProcessingThread;
import core.vector;
//the only purpose of this object is to create an invisible boundary block
public class tokenObject extends solidObject{
public int tileIndex;
public boolean noNeedForThisToken;
public tokenObject(float x, float y, float z, int color){
ID = -1;
type = 4;
teamNo = -1;
centre = new vector(x,y,z);
currentCommand = StandBy;
movement = new vector(0,0,0);
boundary2D = new Rect((int)(x*64) - 8, (int)(z*64) + 8, 16, 16);
tileIndex = boundary2D.x1/16 + (127 - (boundary2D.y1 - 1)/16)*128;
if(x < 0 || mainThread.gridMap.tiles[tileIndex][0]!= null){
noNeedForThisToken = true;
return;
}
if(!(x == 0 && y ==0 && z ==0))
updateOccupiedTiles(boundary2D.x1, boundary2D.y1);
boundary2D.owner = this;
postProcessingThread.theMiniMap.background[tileIndex] = color;
}
public vector getMovement(){
return movement;
}
}