Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Daniele Lucas
ItiAdventure
Commits
a49d3c4d
Commit
a49d3c4d
authored
Mar 29, 2021
by
LucasDANIELE
Browse files
nettoyage + avancement monstre
parent
d04858a1
Changes
30
Hide whitespace changes
Inline
Side-by-side
ITIAdventure/src/ClassMain.java
View file @
a49d3c4d
...
...
@@ -3,279 +3,14 @@ import fr.insarouen.asi.prog.asiaventure.elements.*;
import
fr.insarouen.asi.prog.asiaventure.elements.objets.*
;
import
fr.insarouen.asi.prog.asiaventure.elements.structure.*
;
import
fr.insarouen.asi.prog.asiaventure.elements.vivants.*
;
public
class
ClassMain
{
public
static
void
main
(
String
[]
args
)
throws
NomDEntiteDejaUtiliseDansLeMondeException
,
EntiteDejaDansUnAutreMondeException
,
ObjetNonDeplacableException
,
ObjetAbsentDeLaPieceException
,
VivantAbsentDeLaPieceException
,
ObjetNonPossedeParLeVivantException
{
System
.
out
.
println
(
"############"
);
System
.
out
.
println
(
"##TestMain##"
);
System
.
out
.
println
(
"############"
);
System
.
out
.
println
(
"Test creation monde"
);
Monde
monde
=
new
Monde
(
"nouveauMonde"
);
System
.
out
.
println
(
monde
.
toString
());
System
.
out
.
println
(
"############"
);
System
.
out
.
println
(
"Test entite equals & hashcode"
);
try
{
Entite
entite1
=
new
Entite
(
"nom1"
,
monde
){};
Entite
entite2
=
new
Entite
(
"nom2"
,
monde
){};
System
.
out
.
println
(
"entite1 = entite1 ? "
+
entite1
.
equals
(
entite1
));
System
.
out
.
println
(
"entite1 = entite2 ? "
+
entite1
.
equals
(
entite2
));
System
.
out
.
println
(
"hashcode entite1: "
+
entite1
.
hashCode
());
System
.
out
.
println
(
"hashcode entite2: "
+
entite2
.
hashCode
());
}
catch
(
NomDEntiteDejaUtiliseDansLeMondeException
e
)
{
System
.
err
.
println
(
e
);
}
System
.
out
.
println
(
"############"
);
System
.
out
.
println
(
"Test Monde.getEntite"
);
try
{
Entite
entite0
=
new
Entite
(
"nom0"
,
monde
){};
Entite
entite3
=
monde
.
getEntite
(
"nom0"
);
System
.
out
.
println
(
entite3
.
toString
());
System
.
out
.
println
(
"Entite trouve == entite1 ? "
+
entite3
.
equals
(
entite0
));
System
.
out
.
println
(
"hashcode entite1: "
+
entite0
.
hashCode
());
System
.
out
.
println
(
"hashcode trouve: "
+
entite3
.
hashCode
());
}
catch
(
NomDEntiteDejaUtiliseDansLeMondeException
e
)
{
System
.
err
.
println
(
e
);
}
System
.
out
.
println
(
"############"
);
System
.
out
.
println
(
"Test Valeurs Etat"
);
for
(
Etat
c
:
Etat
.
values
()){
//cf javadoc
System
.
out
.
println
(
c
);
}
System
.
out
.
println
(
"############"
);
System
.
out
.
println
(
"Test Valeurs EtatDuJeu"
);
for
(
EtatDuJeu
c
:
EtatDuJeu
.
values
()){
//cf javadoc
System
.
out
.
println
(
c
);
}
System
.
out
.
println
(
"############"
);
System
.
out
.
println
(
"Test Objet"
);
try
{
Objet
objet
=
new
Objet
(
"objet 1"
,
monde
){
public
boolean
estDeplacable
(){
return
false
;
}
};
System
.
out
.
println
(
"deplacable ? "
+
objet
.
estDeplacable
());
}
catch
(
NomDEntiteDejaUtiliseDansLeMondeException
e
){
System
.
err
.
println
(
e
);
}
System
.
out
.
println
(
"############"
);
System
.
out
.
println
(
"Test Pied De Biche"
);
try
{
PiedDeBiche
pdb
=
new
PiedDeBiche
(
"Super Pied de Biche"
,
monde
);
System
.
out
.
println
(
"deplacable ? "
+
pdb
.
estDeplacable
());
}
catch
(
NomDEntiteDejaUtiliseDansLeMondeException
e
){
System
.
err
.
println
(
e
);
}
System
.
out
.
println
(
"############"
);
System
.
out
.
println
(
"Test Element Structurel"
);
try
{
PiedDeBiche
es
=
new
PiedDeBiche
(
"Element Structurel"
,
monde
);
System
.
out
.
println
(
"deplacable ? "
+
es
.
estDeplacable
());
}
catch
(
NomDEntiteDejaUtiliseDansLeMondeException
e
){
System
.
err
.
println
(
e
);
}
System
.
out
.
println
(
"############"
);
System
.
out
.
println
(
"Test deposer Piece"
);
try
{
PiedDeBiche
pb
=
new
PiedDeBiche
(
"mon pied de biche prefere"
,
monde
);
Objet
o
=
new
Objet
(
"gitare"
,
monde
){
public
boolean
estDeplacable
(){
return
true
;
};
};
Piece
pc
=
new
Piece
(
monde
,
"chambre"
);
pc
.
deposer
(
o
);
pc
.
deposer
(
pb
);
System
.
out
.
println
(
"Piece : "
+
pc
.
toString
());
}
catch
(
NomDEntiteDejaUtiliseDansLeMondeException
e
){
System
.
err
.
println
(
e
);
}
System
.
out
.
println
(
"############"
);
System
.
out
.
println
(
"Test Retirer Piece"
);
try
{
PiedDeBiche
pb
=
new
PiedDeBiche
(
"mon pied de biche"
,
monde
);
Piece
pc
=
new
Piece
(
monde
,
"salon"
);
Objet
o
=
new
Objet
(
"table"
,
monde
){
public
boolean
estDeplacable
(){
return
true
;
};
};
pc
.
deposer
(
o
);
pc
.
deposer
(
pb
);
Objet
objetRetourne
=
pc
.
retirer
(
o
);
System
.
out
.
println
(
"identiques ?"
+
objetRetourne
.
equals
(
o
));
System
.
out
.
println
(
"Piece : "
+
pc
.
toString
());
objetRetourne
=
pc
.
retirer
(
pb
.
getNom
());
System
.
out
.
println
(
"identiques ?"
+
objetRetourne
.
equals
(
pb
));
System
.
out
.
println
(
"Piece : "
+
pc
.
toString
());
}
catch
(
ObjetAbsentDeLaPieceException
e
){
System
.
err
.
println
(
e
);
}
catch
(
ObjetNonDeplacableException
e
){
System
.
err
.
println
(
e
);
}
catch
(
NomDEntiteDejaUtiliseDansLeMondeException
e
){
System
.
err
.
println
(
e
);
}
System
.
out
.
println
(
"############"
);
System
.
out
.
println
(
"Test Contient Objet"
);
Objet
ob1
=
new
Objet
(
"tabl"
,
monde
){
public
boolean
estDeplacable
(){
return
true
;
};
};
Piece
pc
=
new
Piece
(
monde
,
"salle"
);
pc
.
deposer
(
ob1
);
System
.
out
.
println
(
"Objet dans Pièce ? "
+
pc
.
contientObjet
(
ob1
));
pc
.
retirer
(
ob1
);
System
.
out
.
println
(
"Objet dans Pièce ? "
+
pc
.
contientObjet
(
ob1
.
getNom
()));
System
.
out
.
println
(
"############"
);
System
.
out
.
println
(
"Test Prendre Objet"
);
try
{
Objet
obj1
=
new
Objet
(
"banane"
,
monde
){
public
boolean
estDeplacable
(){
return
true
;
}
};
Piece
pc1
=
new
Piece
(
monde
,
"salo"
);
Vivant
v
=
new
Vivant
(
"chambreguache"
,
monde
,
10
,
9
,
pc1
,
ob1
){};
Objet
ob
=
new
Objet
(
"tableau"
,
monde
){
public
boolean
estDeplacable
(){
return
true
;
};
};
pc1
.
deposer
(
obj1
);
v
.
prendre
(
obj1
);
System
.
out
.
println
(
v
.
toString
());
pc1
.
deposer
(
ob1
);
v
.
prendre
(
ob1
.
getNom
());
System
.
out
.
println
(
v
.
toString
());
}
catch
(
NomDEntiteDejaUtiliseDansLeMondeException
e
){
System
.
err
.
println
(
e
);
}
System
.
out
.
println
(
"############"
);
System
.
out
.
println
(
"Test deposer Objet"
);
try
{
Objet
obj2
=
new
Objet
(
"orange"
,
monde
){
public
boolean
estDeplacable
(){
return
true
;
}
};
Piece
pc2
=
new
Piece
(
monde
,
"salle1"
);
Vivant
v1
=
new
Vivant
(
"chambredroite"
,
monde
,
10
,
9
,
pc2
,
obj2
){};
Objet
ob
=
new
Objet
(
"tablette"
,
monde
){
public
boolean
estDeplacable
(){
return
true
;
};
};
v1
.
deposer
(
obj2
);
System
.
out
.
println
(
pc2
.
toString
());
v1
.
prendre
(
obj2
);
System
.
out
.
println
(
pc2
.
toString
());
v1
.
deposer
(
obj2
.
getNom
());
System
.
out
.
println
(
pc2
.
toString
());
}
catch
(
ObjetNonPossedeParLeVivantException
e
){
System
.
err
.
println
(
e
);
}
System
.
out
.
println
(
"############"
);
System
.
out
.
println
(
"Test get Objet"
);
Objet
o
=
new
Objet
(
"pomme"
,
monde
){
public
boolean
estDeplacable
(){
return
true
;
}
};
Piece
pc2
=
new
Piece
(
monde
,
"salle2"
);
Vivant
v
=
new
Vivant
(
"chambre1"
,
monde
,
10
,
9
,
pc2
,
o
){};
System
.
out
.
println
(
"est identiques ? "
+
v
.
getObjet
(
o
.
getNom
()).
equals
(
o
));
System
.
out
.
println
(
"############"
);
System
.
out
.
println
(
"Test possede Objet"
);
Objet
o1
=
new
Objet
(
"pome"
,
monde
){
public
boolean
estDeplacable
(){
return
true
;
}
};
Piece
pc3
=
new
Piece
(
monde
,
"salle3"
);
Vivant
v2
=
new
Vivant
(
"chambre2"
,
monde
,
10
,
9
,
pc3
,
o1
){};
System
.
out
.
println
(
"il possede l'objet ? "
+
v2
.
possede
(
o1
));
System
.
out
.
println
(
"############"
);
System
.
out
.
println
(
"Test get pointvie"
);
System
.
out
.
println
(
"PointVie = 10 ? : "
+
(
v
.
getPointVie
()
==
10
));
System
.
out
.
println
(
"############"
);
System
.
out
.
println
(
"Test estMort"
);
System
.
out
.
println
(
"est mort ? : "
+
(
v
.
getPointVie
()
==
0
));
System
.
out
.
println
(
"############"
);
System
.
out
.
println
(
"Test des Vivants dans Pièces"
);
try
{
Vivant
v1
=
new
Vivant
(
"vivant"
,
monde
,
10
,
9
,
pc3
,
o1
){};
Piece
p
=
new
Piece
(
monde
,
"salon3"
);
p
.
entrer
(
v1
);
System
.
out
.
println
(
p
.
toString
());
p
.
sortir
(
v1
);
System
.
out
.
println
(
p
.
toString
());
}
catch
(
VivantAbsentDeLaPieceException
e
){
System
.
err
.
println
(
e
);
}
System
.
out
.
println
(
"############"
);
System
.
out
.
println
(
"Test contient vivant"
);
Vivant
v1
=
new
Vivant
(
"vivant1"
,
monde
,
10
,
9
,
pc3
,
o1
){};
Piece
p
=
new
Piece
(
monde
,
"salon4"
);
p
.
entrer
(
v1
);
System
.
out
.
println
(
"il contient vivant ? "
+
p
.
contientVivant
(
v1
));
System
.
out
.
println
(
"############"
);
import
fr.insarouen.asi.prog.asiaventure.elements.objets.serrurerie.*
;
public
class
ClassMain
{
public
static
void
main
(
String
[]
args
)
throws
NomDEntiteDejaUtiliseDansLeMondeException
{
Monde
monde
=
new
Monde
(
"monde"
);
Piece
piece
=
new
Piece
(
monde
,
"piece"
);
PiedDeBiche
pdb
=
new
PiedDeBiche
(
"pdb"
,
monde
);
Monstre
monstre
=
new
Monstre
(
"monstre"
,
monde
,
10
,
10
,
piece
,
pdb
);
}
}
//javac -classpath ./classes -sourcepath ./src -d ./classes ./src/ClassMain.java
\ No newline at end of file
ITIAdventure/src/fr/insarouen/asi/prog/asiaventure/ASIAventureException.java
View file @
a49d3c4d
...
...
@@ -2,6 +2,11 @@ package fr.insarouen.asi.prog.asiaventure;
public
class
ASIAventureException
extends
Exception
{
/**
*
*/
private
static
final
long
serialVersionUID
=
1L
;
public
ASIAventureException
(){
super
();
}
...
...
ITIAdventure/src/fr/insarouen/asi/prog/asiaventure/EntiteDejaDansUnAutreMondeException.java
View file @
a49d3c4d
...
...
@@ -2,6 +2,11 @@ package fr.insarouen.asi.prog.asiaventure;
public
class
EntiteDejaDansUnAutreMondeException
extends
MondeException
{
/**
*
*/
private
static
final
long
serialVersionUID
=
1L
;
public
EntiteDejaDansUnAutreMondeException
(
String
msg
){
super
(
msg
);
}
...
...
ITIAdventure/src/fr/insarouen/asi/prog/asiaventure/Monde.java
View file @
a49d3c4d
package
fr.insarouen.asi.prog.asiaventure
;
import
fr.insarouen.asi.prog.asiaventure.elements.*
;
import
fr.insarouen.asi.prog.asiaventure.*
;
import
fr.insarouen.asi.prog.asiaventure.elements.objets.*
;
import
fr.insarouen.asi.prog.asiaventure.elements.vivants.*
;
import
fr.insarouen.asi.prog.asiaventure.elements.structure.*
;
import
java.util.*
;
public
class
Monde
{
...
...
ITIAdventure/src/fr/insarouen/asi/prog/asiaventure/MondeException.java
View file @
a49d3c4d
...
...
@@ -3,6 +3,11 @@ package fr.insarouen.asi.prog.asiaventure;
public
class
MondeException
extends
ASIAventureException
{
/**
*
*/
private
static
final
long
serialVersionUID
=
1L
;
public
MondeException
(
String
msg
){
super
(
msg
);
}
...
...
ITIAdventure/src/fr/insarouen/asi/prog/asiaventure/NomDEntiteDejaUtiliseDansLeMondeException.java
View file @
a49d3c4d
package
fr.insarouen.asi.prog.asiaventure
;
import
fr.insarouen.asi.prog.asiaventure.*
;
public
class
NomDEntiteDejaUtiliseDansLeMondeException
extends
MondeException
{
/**
*
*/
private
static
final
long
serialVersionUID
=
1L
;
public
NomDEntiteDejaUtiliseDansLeMondeException
(){
super
();
}
...
...
ITIAdventure/src/fr/insarouen/asi/prog/asiaventure/elements/ActivationException.java
View file @
a49d3c4d
...
...
@@ -3,6 +3,11 @@ package fr.insarouen.asi.prog.asiaventure.elements;
import
fr.insarouen.asi.prog.asiaventure.ASIAventureException
;
public
class
ActivationException
extends
ASIAventureException
{
/**
*
*/
private
static
final
long
serialVersionUID
=
1L
;
public
ActivationException
(
String
msg
){
super
(
msg
);
}
...
...
ITIAdventure/src/fr/insarouen/asi/prog/asiaventure/elements/ActivationImpossibleAvecObjetException.java
View file @
a49d3c4d
...
...
@@ -5,6 +5,11 @@ package fr.insarouen.asi.prog.asiaventure.elements;
*/
public
class
ActivationImpossibleAvecObjetException
extends
ActivationImpossibleException
{
/**
*
*/
private
static
final
long
serialVersionUID
=
1L
;
/**
* Constructeur de ActivationImpossibleAvecObjetException
*/
...
...
ITIAdventure/src/fr/insarouen/asi/prog/asiaventure/elements/ActivationImpossibleException.java
View file @
a49d3c4d
...
...
@@ -5,6 +5,11 @@ package fr.insarouen.asi.prog.asiaventure.elements;
*/
public
class
ActivationImpossibleException
extends
ActivationException
{
/**
*
*/
private
static
final
long
serialVersionUID
=
1L
;
/**
* Constructeur de ActivationImpossibleException
*/
...
...
ITIAdventure/src/fr/insarouen/asi/prog/asiaventure/elements/Entite.java
View file @
a49d3c4d
package
fr.insarouen.asi.prog.asiaventure.elements
;
import
fr.insarouen.asi.prog.asiaventure.*
;
import
fr.insarouen.asi.prog.asiaventure.elements.objets.*
;
import
fr.insarouen.asi.prog.asiaventure.elements.vivants.*
;
import
fr.insarouen.asi.prog.asiaventure.elements.structure.*
;
public
abstract
class
Entite
{
...
...
@@ -19,10 +16,9 @@ public abstract class Entite {
public
Entite
(
String
nom
,
Monde
monde
)
throws
NomDEntiteDejaUtiliseDansLeMondeException
{
try
{
this
.
nom
=
nom
;
this
.
monde
=
monde
;
try
{
monde
.
ajouter
(
this
);
}
catch
(
EntiteDejaDansUnAutreMondeException
e
){
...
...
@@ -66,7 +62,7 @@ public abstract class Entite {
* @return le String de description
*/
public
String
toString
(){
return
String
.
format
(
"Nom : "
,
this
.
nom
);
return
String
.
format
(
"Nom : "
,
getNom
()
);
}
}
ITIAdventure/src/fr/insarouen/asi/prog/asiaventure/elements/objets/Coffre.java
View file @
a49d3c4d
...
...
@@ -6,9 +6,6 @@ import fr.insarouen.asi.prog.asiaventure.elements.Etat;
import
fr.insarouen.asi.prog.asiaventure.NomDEntiteDejaUtiliseDansLeMondeException
;
import
fr.insarouen.asi.prog.asiaventure.elements.ActivationException
;
import
java.util.HashMap
;
import
java.util.Map
;
/**
* Coffre est la classe représentant un coffre.
*/
...
...
ITIAdventure/src/fr/insarouen/asi/prog/asiaventure/elements/objets/Objet.java
View file @
a49d3c4d
...
...
@@ -3,9 +3,6 @@ package fr.insarouen.asi.prog.asiaventure.elements.objets;
import
fr.insarouen.asi.prog.asiaventure.Monde
;
import
fr.insarouen.asi.prog.asiaventure.elements.Entite
;
import
fr.insarouen.asi.prog.asiaventure.*
;
import
fr.insarouen.asi.prog.asiaventure.elements.objets.*
;
import
fr.insarouen.asi.prog.asiaventure.elements.vivants.*
;
import
fr.insarouen.asi.prog.asiaventure.elements.structure.*
;
public
abstract
class
Objet
extends
Entite
{
...
...
@@ -15,8 +12,7 @@ public abstract class Objet extends Entite{
* @param monde monde de l'objet
* @throws NomDEntiteDejaUtiliseDansLeMondeException
*/
public
Objet
(
String
nom
,
Monde
monde
)
throws
NomDEntiteDejaUtiliseDansLeMondeException
{
public
Objet
(
String
nom
,
Monde
monde
)
throws
NomDEntiteDejaUtiliseDansLeMondeException
{
super
(
nom
,
monde
);
}
...
...
ITIAdventure/src/fr/insarouen/asi/prog/asiaventure/elements/objets/ObjetException.java
View file @
a49d3c4d
...
...
@@ -4,6 +4,11 @@ import fr.insarouen.asi.prog.asiaventure.*;
public
class
ObjetException
extends
ASIAventureException
{
/**
*
*/
private
static
final
long
serialVersionUID
=
1L
;
public
ObjetException
(){
super
();
}
...
...
ITIAdventure/src/fr/insarouen/asi/prog/asiaventure/elements/objets/ObjetNonDeplacableException.java
View file @
a49d3c4d
...
...
@@ -2,6 +2,11 @@ package fr.insarouen.asi.prog.asiaventure.elements.objets;
public
class
ObjetNonDeplacableException
extends
ObjetException
{
/**
*
*/
private
static
final
long
serialVersionUID
=
1L
;
public
ObjetNonDeplacableException
(
String
msg
){
super
(
msg
);
}
...
...
ITIAdventure/src/fr/insarouen/asi/prog/asiaventure/elements/objets/PiedDeBiche.java
View file @
a49d3c4d
package
fr.insarouen.asi.prog.asiaventure.elements.objets
;
import
fr.insarouen.asi.prog.asiaventure.Monde
;
import
fr.insarouen.asi.prog.asiaventure.elements.objets.Objet
;
import
fr.insarouen.asi.prog.asiaventure.*
;
import
fr.insarouen.asi.prog.asiaventure.elements.objets.*
;
import
fr.insarouen.asi.prog.asiaventure.elements.vivants.*
;
import
fr.insarouen.asi.prog.asiaventure.elements.structure.*
;
public
class
PiedDeBiche
extends
Objet
{
...
...
ITIAdventure/src/fr/insarouen/asi/prog/asiaventure/elements/objets/serrurerie/Serrure.java
View file @
a49d3c4d
package
fr.insarouen.asi.prog.asiaventure.elements.objets.serrurerie
;
import
fr.insarouen.asi.prog.asiaventure.elements.Entite
;
import
fr.insarouen.asi.prog.asiaventure.elements.objets.Objet
;
import
fr.insarouen.asi.prog.asiaventure.elements.Activable
;
import
fr.insarouen.asi.prog.asiaventure.Monde
;
import
fr.insarouen.asi.prog.asiaventure.NomDEntiteDejaUtiliseDansLeMondeException
;
import
fr.insarouen.asi.prog.asiaventure.elements.ActivationException
;
import
fr.insarouen.asi.prog.asiaventure.elements.Etat
;
import
fr.insarouen.asi.prog.asiaventure.elements.ActivationImpossibleException
;
import
fr.insarouen.asi.prog.asiaventure.elements.ActivationImpossibleAvecObjetException
;
...
...
@@ -96,6 +94,8 @@ public class Serrure extends Objet implements Activable{
case
DEVERROUILLE:
etat
=
Etat
.
VERROUILLE
;
break
;
default
:
break
;
}
else
throw
new
ActivationImpossibleAvecObjetException
();
...
...
ITIAdventure/src/fr/insarouen/asi/prog/asiaventure/elements/structure/ElementStructurel.java
View file @
a49d3c4d
...
...
@@ -3,9 +3,6 @@ package fr.insarouen.asi.prog.asiaventure.elements.structure;
import
fr.insarouen.asi.prog.asiaventure.Monde
;
import
fr.insarouen.asi.prog.asiaventure.elements.Entite
;
import
fr.insarouen.asi.prog.asiaventure.*
;
import
fr.insarouen.asi.prog.asiaventure.elements.objets.*
;
import
fr.insarouen.asi.prog.asiaventure.elements.vivants.*
;
import
fr.insarouen.asi.prog.asiaventure.elements.structure.*
;
public
abstract
class
ElementStructurel
extends
Entite
{
/**
...
...
ITIAdventure/src/fr/insarouen/asi/prog/asiaventure/elements/structure/ElementStructurelException.java
View file @
a49d3c4d
...
...
@@ -3,6 +3,11 @@ package fr.insarouen.asi.prog.asiaventure.elements.structure;
import
fr.insarouen.asi.prog.asiaventure.*
;
public
class
ElementStructurelException
extends
ASIAventureException
{
/**
*
*/
private
static
final
long
serialVersionUID
=
1L
;
public
ElementStructurelException
(
String
msg
){
super
(
msg
);
}
...
...
ITIAdventure/src/fr/insarouen/asi/prog/asiaventure/elements/structure/ObjetAbsentDeLaPieceException.java
View file @
a49d3c4d
...
...
@@ -2,6 +2,11 @@ package fr.insarouen.asi.prog.asiaventure.elements.structure;
public
class
ObjetAbsentDeLaPieceException
extends
PieceException
{
/**
*
*/
private
static
final
long
serialVersionUID
=
1L
;
public
ObjetAbsentDeLaPieceException
(
String
msg
){
super
(
msg
);
}
...
...
ITIAdventure/src/fr/insarouen/asi/prog/asiaventure/elements/structure/Piece.java
View file @
a49d3c4d
...
...
@@ -4,8 +4,6 @@ import fr.insarouen.asi.prog.asiaventure.*;
import
fr.insarouen.asi.prog.asiaventure.elements.objets.Objet
;
import
fr.insarouen.asi.prog.asiaventure.elements.vivants.Vivant
;
import
fr.insarouen.asi.prog.asiaventure.elements.objets.*
;
import
fr.insarouen.asi.prog.asiaventure.elements.vivants.*
;
import
fr.insarouen.asi.prog.asiaventure.elements.structure.*
;
import
java.util.*
;
...
...
@@ -104,8 +102,7 @@ public class Piece extends ElementStructurel {
* @throws ObjetNonDeplacableException
* @throws ObjetAbsentDeLaPieceException
*/
public
Objet
retirer
(
Objet
_objet
)
throws
ObjetAbsentDeLaPieceException
,
ObjetNonDeplacableException
{
public
Objet
retirer
(
Objet
_objet
)
throws
ObjetAbsentDeLaPieceException
,
ObjetNonDeplacableException
{
return
retirer
(
_objet
.
getNom
());
}
...
...
@@ -192,14 +189,14 @@ public class Piece extends ElementStructurel {
StringBuilder
str
=
new
StringBuilder
(
"PIECE "
);
str
.
append
(
this
.
getNom
());
str
.
append
(
"\n les objets :"
);
for
(
String
s
:
objets
.
keySet
()){
for
(
Objet
o
:
getObjets
()){
str
.
append
(
" - "
);
str
.
append
(
s
);
str
.
append
(
o
);
}
str
.
append
(
";\n Vivants :"
);
for
(
String
s
:
vivants
.
keySet
()){
for
(
Vivant
v
:
vivants
.
values
()){
str
.
append
(
" - "
);
str
.
append
(
s
);