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
af41a2df
Verified
Commit
af41a2df
authored
3 years ago
by
v-lafeychine
Browse files
Options
Downloads
Patches
Plain Diff
Update backend Pokemon
parent
5e2e7266
No related branches found
Branches containing commit
No related tags found
1 merge request
!22
Resolve "Refactor: GameEngine"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/scala/PokemonGame.scala
+3
-1
3 additions, 1 deletion
src/main/scala/PokemonGame.scala
src/main/scala/pokemon/Trainer.scala
+2
-2
2 additions, 2 deletions
src/main/scala/pokemon/Trainer.scala
with
5 additions
and
3 deletions
src/main/scala/PokemonGame.scala
+
3
−
1
View file @
af41a2df
import
Engine.Game
import
Scene.Battle.
{
Battle
,
BattleScene
}
import
Pokemon.
{
PokemonFactory
,
Trainer
}
val
trainer
=
Trainer
(
""
,
List
(
PokemonFactory
(
"Bulbasaur"
),
PokemonFactory
(
"Squirtle"
)),
0
)
val
trainerEnemy
=
Trainer
(
""
,
List
(
PokemonFactory
(
"Charmander"
)),
0
)
class
PokemonGame
()
extends
Game
(
Scene
.
Battle
.
BattleScene
(
trainer
,
trainerEnemy
))
class
PokemonGame
()
extends
Game
(
BattleScen
e
(
Battl
e
(
trainer
,
trainerEnemy
))
);
This diff is collapsed.
Click to expand it.
src/main/scala/pokemon/Trainer.scala
+
2
−
2
View file @
af41a2df
...
...
@@ -5,8 +5,8 @@ class Trainer(val name: String, var listPokemon: List[Pokemon], var indexPrimary
def
numberPokemon:
Int
=
this
.
listPokemon
.
length
def
primaryPokemon
:
Option
[
Pokemon
]
=
this
.
listPokemon
.
lift
(
this
.
indexPrimaryPokemon
)
def
primaryPokemon
:
Pokemon
=
this
.
listPokemon
.
lift
(
this
.
indexPrimaryPokemon
)
.
get
def
changePrimaryPokemon
(
index
:
Int
)
:
Unit
=
assert
(
0
<=
index
&&
index
<
this
.
numberPokemon
,
"This Pokemon doesn't exists."
)
...
...
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