use of src.model.board.EndCase in project Labyrinthe3d by FauconFan.
the class ContentMazeFactory method initiateSpecialCases.
public void initiateSpecialCases(boolean genStart, boolean genEnd) {
ArrayList<Point> oldPoints;
ArrayList<RectInMaze> li;
RectInMaze rim;
Random ran;
int x;
int y;
int max;
Point tmp;
Point tmp2;
ran = new Random();
li = this.mazeDim.getListRectMaze();
oldPoints = new ArrayList<>();
if (genStart) {
tmp = this.genRandomPoint(ran, li, oldPoints);
this.contentSpecialCases.add(new StartCase(tmp.x, tmp.y));
}
if (genEnd) {
tmp = this.genRandomPoint(ran, li, oldPoints);
this.contentSpecialCases.add(new EndCase(tmp.x, tmp.y));
}
max = 0;
if (this.mazeDim.size() >= 200) {
max = 3;
} else if (this.mazeDim.size() >= 100) {
max = 2;
}
for (int i = 0; i < max; i++) {
tmp = this.genRandomPoint(ran, li, oldPoints);
this.contentSpecialCases.add(new SpeedCase(tmp.x, tmp.y, 0.5f));
tmp = this.genRandomPoint(ran, li, oldPoints);
this.contentSpecialCases.add(new TimeCase(tmp.x, tmp.y, 1000));
tmp = this.genRandomPoint(ran, li, oldPoints);
tmp2 = this.genRandomPoint(ran, li, oldPoints);
this.contentSpecialCases.add(new TeleportCase(tmp.x, tmp.y, tmp2.x, tmp2.y));
tmp = this.genRandomPoint(ran, li, oldPoints);
this.contentSpecialCases.add(new JumpCase(tmp.x, tmp.y, 0.05f));
}
}
Aggregations