|
|
|
@ -5,26 +5,21 @@ package modeles;
|
|
|
|
|
|
|
|
|
|
import java.util.*;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @author flavien
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
public class Labyrinthe {
|
|
|
|
|
protected List<Personnage> listePersonnage=new ArrayList<Personnage>();
|
|
|
|
|
protected List<Arme> listeArme= new ArrayList<Arme>();
|
|
|
|
|
protected List<Armure> listeArmure=new ArrayList<Armure>();
|
|
|
|
|
protected List<Porte> listePorte=new ArrayList<Porte>();
|
|
|
|
|
protected List<Monstre> listeMonstre=new ArrayList<Monstre>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void generateLabyrinthe(int nInstance) {
|
|
|
|
|
/*switch (nInstance)
|
|
|
|
|
case 1 :
|
|
|
|
|
case 1 :
|
|
|
|
|
return Labyrinthe1();
|
|
|
|
|
break;
|
|
|
|
|
}*/
|
|
|
|
|
labyrinthe1();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void labyrinthe1() {
|
|
|
|
|
Arme arme=new Arme("Epee en bois",5,10,2);
|
|
|
|
|
listeArme.add(arme);
|
|
|
|
@ -50,69 +45,69 @@ public class Labyrinthe {
|
|
|
|
|
listePersonnage.add(perso);
|
|
|
|
|
Personnage perso2=new Personnage("Boromis",8,2);
|
|
|
|
|
listePersonnage.add(perso2);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Monstre mons = new Monstre("pantin en bois",5, 1);
|
|
|
|
|
Monstre mons2= new Monstre("araignee geante agressive", 7, 5);
|
|
|
|
|
Monstre mons3=new Monstre("pantin de fer",40,1);
|
|
|
|
|
Monstre mons4 = new Monstre("Golem de Jade",40, 3);
|
|
|
|
|
Monstre mons5 = new Monstre("Neltharion le Gardeterre",100,10);
|
|
|
|
|
Monstre mons6 = new Monstre("Neltharion, le Destructeur", 80,20);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.listeMonstre.add(mons);
|
|
|
|
|
this.listeMonstre.add(mons2);
|
|
|
|
|
this.listeMonstre.add(mons3);
|
|
|
|
|
this.listeMonstre.add(mons4);
|
|
|
|
|
this.listeMonstre.add(mons5);
|
|
|
|
|
this.listeMonstre.add(mons6);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Marche marche = new Marche(null);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<Integer>table=new ArrayList<Integer>();
|
|
|
|
|
Random rd= new Random();
|
|
|
|
|
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);
|
|
|
|
|
Porte po = new Porte(true,marche,salle1);
|
|
|
|
|
listePorte.add(po);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<Integer>table2=new ArrayList<Integer>();
|
|
|
|
|
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);
|
|
|
|
|
Porte po2= new Porte(true,marche,salle2);
|
|
|
|
|
listePorte.add(po2);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<Integer>table3=new ArrayList<Integer>();
|
|
|
|
|
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);
|
|
|
|
|
Porte po3= new Porte(true,salle3,salle2);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
listePorte.add(po3);
|
|
|
|
|
List<Integer>table4=new ArrayList<Integer>();
|
|
|
|
|
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);
|
|
|
|
|
Porte po4= new Porte(true,salle4,salle1);
|
|
|
|
|
listePorte.add(po4);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<Integer>table5=new ArrayList<Integer>();
|
|
|
|
|
for (int i = 0; i<rd.nextInt(this.listeMonstre.size());i++) {
|
|
|
|
|
table5.add(rd.nextInt(this.listeMonstre.size()));
|
|
|
|
|
for (int i = 0; i<2;i++) {
|
|
|
|
|
table5.add(listeMonstre.size()-1+i);
|
|
|
|
|
}
|
|
|
|
|
Salle salle5 = new Salle(2,1,true, table5);
|
|
|
|
|
Porte po5= new Porte(true,salle4,salle5);
|
|
|
|
|
listePorte.add(po5);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Porte po6= new Porte(true,salle5,salle3);
|
|
|
|
|
listePorte.add(po6);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|