for (int i = 0 ; i<crossCount; ++i){
if (i==0){
for (int j = 0 ; j < crossCount; ++j){
CrossRoad currCross = new CrossRoad(retVal);
l_crossRoads.add(currCross);
currCross.setCoord(new Point(gorLength*i + gorLength*rand(), vertLength*j + vertLength * rand()));
a_crossRoads[i][j] = currCross;
if (j==0){
continue;
}
r = new Road(retVal);
roads.add(r);
r.setFCross(a_crossRoads[i][j-1]);
r.setLCross(currCross);
((CrossRoad)a_crossRoads[i][j-1]).setRoadForDirection(r, right);
currCross.setRoadForDirection(r, left);
}
continue;
}
for (int j = 0 ; j < crossCount; ++j){
CrossRoad currCross = new CrossRoad(retVal);
l_crossRoads.add(currCross);
currCross.setCoord(new Point(gorLength*i + gorLength*rand(), vertLength*j + vertLength * rand()));
a_crossRoads[i][j] = currCross;
r = new Road(retVal);
roads.add(r);
r.setFCross(a_crossRoads[i-1][j]);
r.setLCross(currCross);