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
bbb9e0ed
Commit
bbb9e0ed
authored
3 years ago
by
phenixceleste
Browse files
Options
Downloads
Patches
Plain Diff
file '7' removed ; setter removed
parent
6a170e65
No related branches found
Branches containing commit
No related tags found
1 merge request
!10
Resolve "Implement use of capacities"
Pipeline
#9720
passed with stage
in 1 minute and 40 seconds
Changes
2
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/scala/backend/Pokemon/7
+0
-26
0 additions, 26 deletions
src/main/scala/backend/Pokemon/7
src/main/scala/backend/Pokemon/Capacity.scala
+1
-4
1 addition, 4 deletions
src/main/scala/backend/Pokemon/Capacity.scala
with
1 addition
and
30 deletions
src/main/scala/backend/Pokemon/7
deleted
100644 → 0
+
0
−
26
View file @
6a170e65
object PokemonFactory:
private case class Bulbasaur()
extends Pokemon(
"Bulbasaur",
11,
List(Grass, Poison),
List(apply("Absorb"), apply("Vine Whip"), apply("Constrict"), apply("Bubble")),
49,
49,
45,
45,
1
)
private case class Charmander()
extends Pokemon(
"Charmander",
12, List(Fire),
List(apply("Bubble"), apply("Bubble Beam"), apply("Rock Throw"), apply("Absorb")),
52, 43, 65, 39, 1)
private case class Squirtle() extends Pokemon("Squirtle", 11, List(Water), List(), 48, 65, 43, 44, 1)
def apply(name: String): Pokemon = name match
case "Bulbasaur" => Bulbasaur()
case "Charmander" => Charmander()
case "Squirtle" => Squirtle()
This diff is collapsed.
Click to expand it.
src/main/scala/backend/Pokemon/Capacity.scala
+
1
−
4
View file @
bbb9e0ed
...
...
@@ -3,8 +3,5 @@ class Capacity(val name: String, val ctype: Type, val maxUses: Int, private var
// getter
def
usesLeft
:
Int
=
this
.
_usesLeft
// setter
def
usesLeft_=
(
uses
:
Int
)
=
this
.
_usesLeft
=
uses
def
use
()
=
this
.
_usesLeft
=
this
.
usesLeft
-
1
this
.
_usesLeft
=
this
.
_
usesLeft
-
1
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