package ds.moteur;
import ds.moteur.geometrie.Angle3D;
import ds.moteur.geometrie.Point;
import ds.moteur.route.Carrefour;
import ds.moteur.route.Route;
import ds.moteur.route.personnalise.Carrefour3Branches;
import ds.moteur.route.personnalise.RouteCourbe;
import ds.moteur.route.personnalise.RouteDroite;
public class TerrainDefaut2 extends Terrain {
public TerrainDefaut2() {
super("Defaut 2");
Carrefour carrefour1 = new Carrefour3Branches(new Point(-61, 0), new Angle3D(Math.PI/2, 0), 3);
Carrefour carrefour2 = new Carrefour3Branches(new Point(51, 40*(2-Math.sqrt(3))), new Angle3D(-Math.PI/2, 0), 3);
Route route1 = RouteDroite.createRoute(new Point(-40, 0), new Angle3D(0, 0), "Route 1", 30, 3, 1, false);
Route route2 = new RouteCourbe(new Point(-25, 40), new Angle3D(7*Math.PI/6, 0), "Toto", 40, 3, Math.PI/6);
Route route3 = new RouteCourbe(new Point(15, -40 + 40*(2-Math.sqrt(3))), new Angle3D(Math.PI/6, 0), "Toto", 40, 3, Math.PI/6);
Route route4 = RouteDroite.createRoute(new Point(30, 40*(2-Math.sqrt(3))), new Angle3D(0, 0), "Route 4", 30, 3, 1, false);
Route route5 = new RouteCourbe(new Point(-71, 6), new Angle3D(Math.PI/2, 0), "Toto", 10, 3, Math.PI);
Route route6 = new RouteCourbe(new Point(-71, -6), new Angle3D(-Math.PI/2, 0), "Toto", 10, 3, Math.PI);
Route route7 = RouteDroite.createRoute(new Point(-81, 0), new Angle3D(Math.PI/2, 0), "Toto", 12, 3, 1, false);
Route route8 = new RouteCourbe(new Point(59, 40*(2-Math.sqrt(3)) + 6), new Angle3D(Math.PI/2, 0), "Toto", 8, 3, Math.PI/2);
Route route9 = new RouteCourbe(new Point(59, 40*(2-Math.sqrt(3)) - 6), new Angle3D(Math.PI, 0), "Toto", 8, 3, Math.PI/2);
Route route10 = new RouteCourbe(new Point(59, 40*(2-Math.sqrt(3))), new Angle3D(0, 0), "Toto", 14, 3, Math.PI);
/*Route route8 = new RouteDroite(new Point(0, -7.5), new Angle3D(Math.PI/2, 0), "Toto", 5, 2.5);
Route route9 = new RouteDroite(new Point(7.5, 0), new Angle3D(0, 0), "Toto", 5, 2.5);
Route route10 = new RouteDroite(new Point(7.5, -15), new Angle3D(0, 0), "Toto", 5, 2.5);
Route route11 = new RouteDroite(new Point(15, -7.5), new Angle3D(Math.PI/2, 0), "Toto", 5, 2.5);
Route route12 = new RouteCourbe(new Point(20, -7.5), new Angle3D(0, 0), "Toto", 7.5, 2.5, Math.PI);*/
this.addSection(carrefour1);
this.addSection(carrefour2);
this.addSection(route1);
this.addSection(route2);
this.addSection(route3);
this.addSection(route4);
this.addSection(route5);
this.addSection(route6);
this.addSection(route7);
this.addSection(route8);
this.addSection(route9);
this.addSection(route10);
/*this.addSection(route11);
this.addSection(route12);*/
this.calculerTerrainAbsolu();
carrefour1.addConnexion(route1);
carrefour1.addConnexion(route5);
carrefour1.addConnexion(route6);
carrefour2.addConnexion(route4);
carrefour2.addConnexion(route8);
carrefour2.addConnexion(route9);
route1.addConnexion(carrefour1);
route1.addConnexion(route2);
route2.addConnexion(route1);
route2.addConnexion(route3);
route3.addConnexion(route2);
route3.addConnexion(route4);
route4.addConnexion(route3);
route4.addConnexion(carrefour2);
route5.addConnexion(carrefour1);
route5.addConnexion(route7);
route6.addConnexion(carrefour1);
route6.addConnexion(route7);
route7.addConnexion(route5);
route7.addConnexion(route6);
route8.addConnexion(carrefour2);
route8.addConnexion(route10);
route9.addConnexion(carrefour2);
route9.addConnexion(route10);
route10.addConnexion(route8);
route10.addConnexion(route9);
this.etablirConnexion();
//System.out.println(this.essayerLienBidirectionnel(carrefour1, carrefour2));
this.addInsertion(route2.getEntrees().get(1));
this.addInsertion(route1.getEntrees().get(1));
this.addInsertion(route4.getEntrees().get(0));
}
}