-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
85 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="src" path="src"/> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> | ||
<classpathentry kind="output" path="bin"/> | ||
</classpath> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
|
||
/bin/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>LesGaulois</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.jdt.core.javabuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
</natures> | ||
</projectDescription> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package personnages; | ||
|
||
public class Gaulois { | ||
private String nom; | ||
private int force; | ||
private int effetPotion = 1; | ||
public Gaulois(String nom, int force) { | ||
this.nom = nom; | ||
this.force = force; | ||
} | ||
public String getNom() { | ||
return nom; | ||
} | ||
public void parler(String texte) { | ||
System.out.println(prendreParole() + "« " + texte + "»"); | ||
} | ||
private String prendreParole() { | ||
return "Le gaulois " + nom + " : "; | ||
} | ||
public void frapper(Romain romain) { | ||
System.out.println(nom + " envoie un grand coup dans la mâchoire de " + romain.getNom()); | ||
romain.recevoirCoup(force / 3); | ||
} | ||
@Override | ||
public String toString() { | ||
return "Gaulois [nom=" + nom + ", force=" + force + ", effetPotion=" + effetPotion + "]"; | ||
} | ||
public static void main(String[] args) { | ||
//TODO créer un main permettant de tester la classe Gaulois | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package personnages; | ||
|
||
public class Romain { | ||
private String nom; | ||
private int force; | ||
public Romain(String nom, int force) { | ||
this.nom = nom; | ||
this.force = force; | ||
} | ||
public String getNom() { | ||
return nom; | ||
} | ||
public void parler(String texte) { | ||
System.out.println(prendreParole() + "« " + texte + "»"); | ||
} | ||
private String prendreParole() { | ||
return "Le romain " + nom + " : "; | ||
} | ||
public void recevoirCoup(int forceCoup) { | ||
force -= forceCoup; | ||
if (force > 0) { | ||
parler("Aïe"); | ||
} else { | ||
parler("J'abandonne..."); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
package personnages; | ||
|