Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
L3 - Projet programmation 2
Manage
Activity
Members
Labels
Plan
Issues
4
Issue boards
Milestones
Wiki
Code
Merge requests
1
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
v-lafeychine
L3 - Projet programmation 2
Commits
90528d6a
Commit
90528d6a
authored
3 years ago
by
phenixceleste
Browse files
Options
Downloads
Patches
Plain Diff
useCapcity returns Unit
parent
ca96bce0
No related branches found
Branches containing commit
No related tags found
1 merge request
!16
Resolve "Add random fight response"
Pipeline
#9753
failed with stage
in 1 minute and 41 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/scala/pokemon/Pokemon.scala
+2
-3
2 additions, 3 deletions
src/main/scala/pokemon/Pokemon.scala
with
2 additions
and
3 deletions
src/main/scala/pokemon/Pokemon.scala
+
2
−
3
View file @
90528d6a
...
...
@@ -25,7 +25,7 @@ trait Pokemon(
def
speed
:
Int
=
5
+
scala
.
math
.
floor
(
2.0
*
this
.
baseSpeed
*
this
.
level
/
100.0
).
toInt
def
maxLife
:
Int
=
scala
.
math
.
floor
(
2.0
*
this
.
baseSpeed
*
this
.
level
/
100.0
).
toInt
+
10
+
this
.
level
def
useCapacity
(
capacity
:
Capacity
,
other
:
Pokemon
)
:
Boolean
=
def
useCapacity
(
capacity
:
Capacity
,
other
:
Pokemon
)
:
Unit
=
assert
(
capacity
.
isUsable
,
"This capacity is not usable."
)
...
...
@@ -41,10 +41,9 @@ trait Pokemon(
other
.
decreaseLife
(
Math
.
round
(
damage
.
toFloat
))
def
decreaseLife
(
x
:
Int
)
:
Boolean
=
def
decreaseLife
(
x
:
Int
)
:
Unit
=
if
this
.
life
-
x
<=
0
then
this
.
_life
=
0
else
this
.
_life
=
this
.
life
-
x
this
.
isAlive
def
isAlive
:
Boolean
=
this
.
life
!=
0
...
...
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