Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Inondation - RAKOTOARISOA
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
RAKOTOARISOA Andrianinarisaina cy
Inondation - RAKOTOARISOA
Commits
d2b43511
Commit
d2b43511
authored
2 years ago
by
RAKOTOARISOA Andrianinarisaina cy
Browse files
Options
Downloads
Patches
Plain Diff
Tâche 1 : Les 3 constructeurs de la classe SquareCell
parent
2f57ed5d
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.md
+2
-2
2 additions, 2 deletions
README.md
app/src/main/java/model/SquareCell.java
+22
-5
22 additions, 5 deletions
app/src/main/java/model/SquareCell.java
with
24 additions
and
7 deletions
README.md
+
2
−
2
View file @
d2b43511
# Flooding
## Description du projet
Il s'agit d'implémenter une version du jeu "inondation" (voir par exemple
[
ici
](
[Flood-it!](https://unixpapa.com/floodit
)
, ainsi que des intelligences artificiels simples pour y jouer.
## Membre du projet
-
RAKOTOARISOA, Andrianina
This diff is collapsed.
Click to expand it.
app/src/main/java/model/SquareCell.java
+
22
−
5
View file @
d2b43511
...
...
@@ -2,19 +2,36 @@ package model;
import
javafx.scene.paint.Color
;
import
java.util.ArrayList
;
import
java.util.Iterator
;
import
java.util.List
;
public
class
SquareCell
extends
AbstractCell
{
List
<
Cell
>
neighbours
;
Color
color
;
//constructeur 1 : un constructeur sans paramètres qui construit une liste de cellule vide
//de couleur DEFAULT_CELL_COLOR avec une liste de voisins vide
public
void
SquareCell
()
{
this
.
neighbours
=
new
ArrayList
<
Cell
>()
;
color
=
DEFAULT_CELL_COLOR
;
}
//Constructeur 2 : un constructeur ayant en paramètre une couleur color
//qui construit une cellule de couleur color et dont les voisins sont vides
public
void
SquareCell
(
Color
color
)
{
this
.
neighbours
=
new
ArrayList
<
Cell
>()
;
this
.
color
=
color
;
}
//Constructeur 3 : un constructeur avec deux paramètres : "Color color" et "ArrayList<Cell> neighbours
//qui consrtuit une cellule de couleur color et dont les cellules voisines sont neighours
public
void
SquareCell
(
Color
color
,
List
<
Cell
>
neighbours
)
{
this
.
neighbours
=
neighbours
;
this
.
color
=
color
;
}
/**
* A cell is placed somewhere on a grid. Its neighbours thus depend on the underlying grid.
*
* @return the list of cell that are neighbours of this{@code Cell}.
*/
@Override
public
List
<
Cell
>
getNeighbours
()
{
return
null
;
...
...
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