-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSet3DMode.java
60 lines (51 loc) · 1.6 KB
/
Set3DMode.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
import processing.core.*;
import processing.data.*;
import java.util.ArrayList;
class Set3DMode extends LogicOutputComponent {
public static final Identifier ID = new Identifier("Set3DMode");
int groupNumber=0;
float offset=0;
Set3DMode(float x, float y, LogicBoard lb) {
super(x, y, " set 3D ", lb);
}
Set3DMode(JSONObject data, LogicBoard lb) {
super(data.getFloat("x"), data.getFloat("y"), " set 3D ", lb, data.getJSONArray("connections"));
}
public Set3DMode(SerialIterator iterator){
super(iterator);
groupNumber = iterator.getInt();
offset = iterator.getFloat();
}
void tick() {
if (inputTerminal1) {
if (source.level.stages.get(source.currentStageIndex).type.equals("3Dstage"))
if (source.level.multyplayerMode!=2)
source.e3DMode=true;
}
if (inputTerminal2) {
if (source.level.stages.get(source.currentStageIndex).type.equals("3Dstage"))
if (source.level.multyplayerMode!=2)
source.e3DMode=false;
}
}
void draw() {
super.draw();
source.fill(0);
source.textSize(15*source.Scale);
source.textAlign(source.LEFT, source.CENTER);
source.text("true", (x+5-source.camPos)*source.Scale, (y+16-source.camPosY)*source.Scale);
source.text("false", (x+5-source.camPos)*source.Scale, (y+56-source.camPosY)*source.Scale);
}
@Override
public SerializedData serialize() {
SerializedData data = new SerializedData(id());
serialize(data);
data.addInt(groupNumber);
data.addFloat(offset);
return data;
}
@Override
public Identifier id() {
return ID;
}
}