|
|
@ -5,10 +5,6 @@ package modeles;
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.*;
|
|
|
|
import java.util.*;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* @author flavien
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
public class Labyrinthe {
|
|
|
|
public class Labyrinthe {
|
|
|
|
protected List<Personnage> listePersonnage=new ArrayList<Personnage>();
|
|
|
|
protected List<Personnage> listePersonnage=new ArrayList<Personnage>();
|
|
|
|
protected List<Arme> listeArme= new ArrayList<Arme>();
|
|
|
|
protected List<Arme> listeArme= new ArrayList<Arme>();
|
|
|
@ -18,13 +14,12 @@ public class Labyrinthe {
|
|
|
|
|
|
|
|
|
|
|
|
public void generateLabyrinthe(int nInstance) {
|
|
|
|
public void generateLabyrinthe(int nInstance) {
|
|
|
|
/*switch (nInstance)
|
|
|
|
/*switch (nInstance)
|
|
|
|
case 1 :
|
|
|
|
case 1 :
|
|
|
|
return Labyrinthe1();
|
|
|
|
return Labyrinthe1();
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}*/
|
|
|
|
}*/
|
|
|
|
labyrinthe1();
|
|
|
|
labyrinthe1();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void labyrinthe1() {
|
|
|
|
public void labyrinthe1() {
|
|
|
|
Arme arme=new Arme("Epee en bois",5,10,2);
|
|
|
|
Arme arme=new Arme("Epee en bois",5,10,2);
|
|
|
|
listeArme.add(arme);
|
|
|
|
listeArme.add(arme);
|
|
|
@ -70,7 +65,7 @@ public class Labyrinthe {
|
|
|
|
List<Integer>table=new ArrayList<Integer>();
|
|
|
|
List<Integer>table=new ArrayList<Integer>();
|
|
|
|
Random rd= new Random();
|
|
|
|
Random rd= new Random();
|
|
|
|
for (int i = 0; i<rd.nextInt(this.listeMonstre.size());i++) {
|
|
|
|
for (int i = 0; i<rd.nextInt(this.listeMonstre.size());i++) {
|
|
|
|
table.add(rd.nextInt(this.listeMonstre.size()));
|
|
|
|
table.add(rd.nextInt(this.listeMonstre.size()-2));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Salle salle1 = new Salle(1,0,false,table);
|
|
|
|
Salle salle1 = new Salle(1,0,false,table);
|
|
|
|
Porte po = new Porte(true,marche,salle1);
|
|
|
|
Porte po = new Porte(true,marche,salle1);
|
|
|
@ -78,7 +73,7 @@ public class Labyrinthe {
|
|
|
|
|
|
|
|
|
|
|
|
List<Integer>table2=new ArrayList<Integer>();
|
|
|
|
List<Integer>table2=new ArrayList<Integer>();
|
|
|
|
for (int i = 0; i<rd.nextInt(this.listeMonstre.size());i++) {
|
|
|
|
for (int i = 0; i<rd.nextInt(this.listeMonstre.size());i++) {
|
|
|
|
table2.add(rd.nextInt(this.listeMonstre.size()));
|
|
|
|
table2.add(rd.nextInt(this.listeMonstre.size()-2));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Salle salle2 = new Salle(0,1,false, table2);
|
|
|
|
Salle salle2 = new Salle(0,1,false, table2);
|
|
|
|
Porte po2= new Porte(true,marche,salle2);
|
|
|
|
Porte po2= new Porte(true,marche,salle2);
|
|
|
@ -86,7 +81,7 @@ public class Labyrinthe {
|
|
|
|
|
|
|
|
|
|
|
|
List<Integer>table3=new ArrayList<Integer>();
|
|
|
|
List<Integer>table3=new ArrayList<Integer>();
|
|
|
|
for (int i = 0; i<rd.nextInt(this.listeMonstre.size());i++) {
|
|
|
|
for (int i = 0; i<rd.nextInt(this.listeMonstre.size());i++) {
|
|
|
|
table3.add(rd.nextInt(this.listeMonstre.size()));
|
|
|
|
table3.add(rd.nextInt(this.listeMonstre.size()-2));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Salle salle3 = new Salle(1,1,false, table3);
|
|
|
|
Salle salle3 = new Salle(1,1,false, table3);
|
|
|
|
Porte po3= new Porte(true,salle3,salle2);
|
|
|
|
Porte po3= new Porte(true,salle3,salle2);
|
|
|
@ -94,15 +89,15 @@ public class Labyrinthe {
|
|
|
|
listePorte.add(po3);
|
|
|
|
listePorte.add(po3);
|
|
|
|
List<Integer>table4=new ArrayList<Integer>();
|
|
|
|
List<Integer>table4=new ArrayList<Integer>();
|
|
|
|
for (int i = 0; i<rd.nextInt(this.listeMonstre.size());i++) {
|
|
|
|
for (int i = 0; i<rd.nextInt(this.listeMonstre.size());i++) {
|
|
|
|
table4.add(rd.nextInt(this.listeMonstre.size()));
|
|
|
|
table4.add(rd.nextInt(this.listeMonstre.size()-2));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Salle salle4 = new Salle(2,0,false, table4);
|
|
|
|
Salle salle4 = new Salle(2,0,false, table4);
|
|
|
|
Porte po4= new Porte(true,salle4,salle1);
|
|
|
|
Porte po4= new Porte(true,salle4,salle1);
|
|
|
|
listePorte.add(po4);
|
|
|
|
listePorte.add(po4);
|
|
|
|
|
|
|
|
|
|
|
|
List<Integer>table5=new ArrayList<Integer>();
|
|
|
|
List<Integer>table5=new ArrayList<Integer>();
|
|
|
|
for (int i = 0; i<rd.nextInt(this.listeMonstre.size());i++) {
|
|
|
|
for (int i = 0; i<2;i++) {
|
|
|
|
table5.add(rd.nextInt(this.listeMonstre.size()));
|
|
|
|
table5.add(listeMonstre.size()-1+i);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Salle salle5 = new Salle(2,1,true, table5);
|
|
|
|
Salle salle5 = new Salle(2,1,true, table5);
|
|
|
|
Porte po5= new Porte(true,salle4,salle5);
|
|
|
|
Porte po5= new Porte(true,salle4,salle5);
|
|
|
|