Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
Vigneron-Steven-DP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VIGNERON Steven
Vigneron-Steven-DP
Commits
0ac845b6
Commit
0ac845b6
authored
6 months ago
by
VIGNERON Steven
Browse files
Options
Downloads
Patches
Plain Diff
fix V7
parent
53030d3c
Branches
Branches containing commit
Tags
V7
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
doc/V7.png
+0
-0
0 additions, 0 deletions
doc/V7.png
doc/plantuml/V7.txt
+2
-1
2 additions, 1 deletion
doc/plantuml/V7.txt
src/main/java/DP/Personnage.java
+11
-9
11 additions, 9 deletions
src/main/java/DP/Personnage.java
tests/TestV5.java
+1
-1
1 addition, 1 deletion
tests/TestV5.java
with
14 additions
and
11 deletions
doc/V7.png
+
0
−
0
View replaced file @
53030d3c
View file @
0ac845b6
219 KiB
|
W:
|
H:
219 KiB
|
W:
|
H:
2-up
Swipe
Onion skin
This diff is collapsed.
Click to expand it.
doc/plantuml/V7.txt
+
2
−
1
View file @
0ac845b6
...
@@ -29,11 +29,12 @@ package DP{
...
@@ -29,11 +29,12 @@ package DP{
#int niveau
#int niveau
#String nom
#String nom
+ Personnage(int pointsDeVie, String nom, Arme arme)
+ Personnage(int pointsDeVie, String nom, Arme arme)
+ void subirDegats(int d)
+ void setStrategie(StrategieCombat strategie)
+ void setStrategie(StrategieCombat strategie)
+ boolean estVivant()
+ boolean estVivant()
+ void setEtat(Etat etat)
+ void setEtat(Etat etat)
+ Etat getEtat()
+ Etat getEtat()
+ void attaquer()
+ void subirDegats(int d)
}
}
Personnage -left- "1" Arme
Personnage -left- "1" Arme
Personnage -- "1" StrategieCombat
Personnage -- "1" StrategieCombat
...
...
This diff is collapsed.
Click to expand it.
src/main/java/DP/Personnage.java
+
11
−
9
View file @
0ac845b6
...
@@ -26,6 +26,8 @@ public abstract class Personnage implements ComposantEquipe {
...
@@ -26,6 +26,8 @@ public abstract class Personnage implements ComposantEquipe {
public
void
setPointsDeVie
(
int
pointsDeVie
)
{
public
void
setPointsDeVie
(
int
pointsDeVie
)
{
if
(
pointsDeVie
>
0
)
{
if
(
pointsDeVie
>
0
)
{
this
.
pointsDeVie
=
pointsDeVie
;
this
.
pointsDeVie
=
pointsDeVie
;
}
else
{
this
.
pointsDeVie
=
0
;
}
}
}
}
...
@@ -82,15 +84,6 @@ public abstract class Personnage implements ComposantEquipe {
...
@@ -82,15 +84,6 @@ public abstract class Personnage implements ComposantEquipe {
}
}
}
}
// garder uniquement pour les tests de V5
public
void
subirDegats
(
int
d
)
{
int
degats
=
strategie
.
modifieDegats
(
d
);
pointsDeVie
-=
degats
;
if
(
pointsDeVie
<=
0
)
{
this
.
setEtat
(
new
EtatMort
(
this
));
}
}
public
void
setEtat
(
Etat
etat
){
public
void
setEtat
(
Etat
etat
){
this
.
etat
=
etat
;
this
.
etat
=
etat
;
}
}
...
@@ -98,4 +91,13 @@ public abstract class Personnage implements ComposantEquipe {
...
@@ -98,4 +91,13 @@ public abstract class Personnage implements ComposantEquipe {
public
Etat
getEtat
(){
public
Etat
getEtat
(){
return
this
.
etat
;
return
this
.
etat
;
}
}
public
void
attaquer
(
Personnage
p
){
etat
.
attaquer
(
p
);
}
public
void
subirDegats
(
int
d
){
etat
.
subirDegats
(
d
);
}
}
}
This diff is collapsed.
Click to expand it.
tests/TestV5.java
+
1
−
1
View file @
0ac845b6
...
@@ -52,7 +52,7 @@ public class TestV5 {
...
@@ -52,7 +52,7 @@ public class TestV5 {
r
.
subirDegats
(
attaqueDuGuerrier
);
r
.
subirDegats
(
attaqueDuGuerrier
);
// le roi a 100 points de vie et recoie un coup de 50*2*2 degats
// le roi a 100 points de vie et recoie un coup de 50*2*2 degats
assertEquals
(
"Le roi devrais avoir 0 points de vie"
,
-
10
0
,
r
.
getPointsDeVie
());
assertEquals
(
"Le roi devrais avoir 0 points de vie"
,
0
,
r
.
getPointsDeVie
());
assertEquals
(
"Le roi devrais etre mort"
,
false
,
r
.
estVivant
());
assertEquals
(
"Le roi devrais etre mort"
,
false
,
r
.
estVivant
());
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment