Compare commits
4 Commits
master
...
listemarch
Author | SHA1 | Date | |
---|---|---|---|
8633eea5e4 | |||
451ea3c01e | |||
e3a59197c0 | |||
28a9a15549 |
@ -1,12 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry exported="true" kind="lib" path="/home/nicolas/Bureau/jdbc-support-1.0.23-sources.jar">
|
||||
<classpathentry kind="lib" path="/Users/flavien/Seafile/UPSSITECH/programmation/java/Projet_Java/JAVA/PROJET-PMT_STRI1A/src/jdbc-support-1.0.23-sources.jar">
|
||||
<attributes>
|
||||
<attribute name="module" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry exported="true" kind="lib" path="/home/nicolas/Téléchargements/gson-2.8.5.jar">
|
||||
<classpathentry kind="lib" path="/Users/flavien/Seafile/UPSSITECH/programmation/java/Projet_Java/JAVA/PROJET-PMT_STRI1A/src/gson-2.8.5.jar">
|
||||
<attributes>
|
||||
<attribute name="module" value="true"/>
|
||||
</attributes>
|
||||
|
BIN
JAVA/PROJET-PMT_STRI1A/src/.DS_Store
vendored
Normal file
BIN
JAVA/PROJET-PMT_STRI1A/src/.DS_Store
vendored
Normal file
Binary file not shown.
BIN
JAVA/PROJET-PMT_STRI1A/src/gson-2.8.5.jar
Normal file
BIN
JAVA/PROJET-PMT_STRI1A/src/gson-2.8.5.jar
Normal file
Binary file not shown.
BIN
JAVA/PROJET-PMT_STRI1A/src/jdbc-support-1.0.23-sources.jar
Executable file
BIN
JAVA/PROJET-PMT_STRI1A/src/jdbc-support-1.0.23-sources.jar
Executable file
Binary file not shown.
@ -17,12 +17,11 @@ public class Armure extends Objet {
|
||||
return "Armure";
|
||||
}
|
||||
|
||||
public Armure(String nm, int valeur, int resistance,int efficacité) {
|
||||
public Armure(String nm, int valeur, int resistance,int efficacit<EFBFBD>) {
|
||||
super(nm, valeur, resistance);
|
||||
this.pArmure=efficacité;
|
||||
this.pArmure=efficacit<EFBFBD>;
|
||||
}
|
||||
|
||||
|
||||
/* public armureEffect(...) */
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,7 @@ public class Generateur {
|
||||
public Labyrinthe labyrinthe() {
|
||||
BufferedReader bfr= null;
|
||||
try {
|
||||
bfr = new BufferedReader(new FileReader("C:\\Users\\Nicolas\\eclipse-workspace\\Projet_Java\\JAVA\\PROJET-PMT_STRI1A\\src\\json\\lab.json"));
|
||||
bfr = new BufferedReader(new FileReader("~lab.json"));
|
||||
} catch (FileNotFoundException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
@ -34,7 +34,7 @@ public class Generateur {
|
||||
String str = gson.toJson(lab);
|
||||
System.out.println(str);
|
||||
try {
|
||||
File file = new File("C:\\Users\\Nicolas\\eclipse-workspace\\Projet_Java\\JAVA\\PROJET-PMT_STRI1A\\src\\json\\lab.json");
|
||||
File file = new File("~lab.json");
|
||||
|
||||
file.createNewFile();
|
||||
FileWriter writer = new FileWriter(file);
|
||||
|
@ -1,6 +1,3 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package modeles;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@ -10,13 +7,40 @@ import java.util.List;
|
||||
* @author flavien
|
||||
*
|
||||
*/
|
||||
|
||||
public class Marche extends Salle {
|
||||
private List<Integer> listeObjet=new ArrayList<Integer>();
|
||||
public Marche(List<Integer> listeEnnemie) {
|
||||
super(0,0, false, listeEnnemie);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
|
||||
//methode pour enregistrer la liste objet (il faudra sans doute changer le type de listeObjet) settingListeObjet(Labyrinthe lab)
|
||||
public String creerObjetsAVendre(Labyrinthe lab) {
|
||||
String listeSarme="";
|
||||
String listeSarmure="";
|
||||
String listeobjet="";
|
||||
int i = 0;
|
||||
int j = 0;
|
||||
|
||||
for (Arme arme : lab.listeArme) {
|
||||
//stringifier les armes
|
||||
listeSarme += arme.toString() + " au prix de : " + arme.getPrix()+ "\n";
|
||||
i++;
|
||||
}
|
||||
|
||||
for (Armure armure : lab.listeArmure) {
|
||||
//stringifier les armures
|
||||
listeSarmure += armure.toString()+ " au prix de : " + armure.getPrix() + "\n";
|
||||
j++;
|
||||
}
|
||||
|
||||
listeobjet = "Armes :\n" + listeSarme + "Armes :\n" + listeSarmure;
|
||||
|
||||
return listeobjet;
|
||||
}
|
||||
|
||||
public void vendreObjet(Objet objet, Personnage personnage) {
|
||||
personnage.setBourse((personnage.getBourse()) - (objet.getPrix()));
|
||||
listeObjet.remove(objet);
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
package modeles;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@ -20,7 +19,8 @@ public class Personnage extends EtreVivant {
|
||||
arme.setProprietaire(this);
|
||||
this.arme=arme;
|
||||
}
|
||||
public void equiper(Armure armure) {
|
||||
|
||||
public void equiper(Armure armure) {
|
||||
armure.setProprietaire(this);
|
||||
this.armure=armure;
|
||||
}
|
||||
@ -65,6 +65,13 @@ public void equiper(Armure armure) {
|
||||
return this.bourse;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bourse the bourse to set
|
||||
*/
|
||||
public void setBourse(Bourse bourse) {
|
||||
this.bourse = bourse;
|
||||
}
|
||||
|
||||
public int getValeurBourse() {
|
||||
return this.getBourse().getValeur();
|
||||
}
|
||||
@ -78,7 +85,7 @@ public void equiper(Armure armure) {
|
||||
public String obtenirBourse() {
|
||||
Random rd = new Random();
|
||||
this.bourse.fusionBourse(new Bourse(rd.nextInt(20)));
|
||||
String str="Vous avez gagnez une bourse. Vous comptez vos pièces... Genial !! Vous avez désormais ".concat(String.valueOf(this.getValeurBourse()).concat(" pièces d'argent !"));
|
||||
String str="Vous avez gagnez une bourse. Vous comptez vos pi<EFBFBD>ces... Genial !! Vous avez d<>sormais ".concat(String.valueOf(this.getValeurBourse()).concat(" pi<EFBFBD>ces d'argent !"));
|
||||
return str;
|
||||
|
||||
}
|
||||
|
@ -40,5 +40,20 @@ public class Porte {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the salle1
|
||||
*/
|
||||
public Salle getSalle1() {
|
||||
return salle1;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param salle1 the salle1 to set
|
||||
*/
|
||||
public void setSalle1(Salle salle1) {
|
||||
this.salle1 = salle1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -47,4 +47,6 @@ public class Salle {
|
||||
public List<Integer> getListePorte() {
|
||||
return this.listePorte;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
20
JAVA/PROJET-PMT_STRI1A/src/modeles/Test.java
Normal file
20
JAVA/PROJET-PMT_STRI1A/src/modeles/Test.java
Normal file
@ -0,0 +1,20 @@
|
||||
package modeles;
|
||||
|
||||
/**
|
||||
* @author flavien
|
||||
*
|
||||
*/
|
||||
public class Test {
|
||||
public static void main(String[] args) {
|
||||
Menu menu = new Menu();
|
||||
|
||||
Labyrinthe lab;
|
||||
|
||||
lab = menu.menuStartGame();
|
||||
|
||||
Marche marche = (Marche)lab.listePorte.get(0).getSalle1();
|
||||
|
||||
System.out.println(marche.creerObjetsAVendre(lab));
|
||||
}
|
||||
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
package test;
|
||||
|
||||
/**
|
||||
* @author flavien
|
||||
*
|
||||
*/
|
||||
public class Test {
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user