Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TP6
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
BEL KHALIFA Mohamed amine
TP6
Commits
27665821
Commit
27665821
authored
2 years ago
by
BEL KHALIFA Mohamed amine
Browse files
Options
Downloads
Patches
Plain Diff
Class SquareCell and ArrayGrid
parent
aeb942ad
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/src/main/java/model/ArrayGrid.java
+29
-0
29 additions, 0 deletions
app/src/main/java/model/ArrayGrid.java
app/src/main/java/model/SquareCell.java
+3
-4
3 additions, 4 deletions
app/src/main/java/model/SquareCell.java
with
32 additions
and
4 deletions
app/src/main/java/model/ArrayGrid.java
0 → 100644
+
29
−
0
View file @
27665821
package
model
;
public
class
ArrayGrid
implements
Grid
{
public
void
arrayGrid
(
int
numberOfRows
,
int
numberOfColumn
)
{
if
(
numberOfRows
<=
0
||
numberOfColumn
<=
0
)
throw
new
IllegalArgumentException
(
"Le nombre de lignes ou de colonnes ne peut pas être nul ou négatif."
);
Cell
[][]
cells
=
new
Cell
[
numberOfRows
][
numberOfColumn
];
for
(
int
i
=
0
;
i
<
numberOfRows
;
i
++)
{
for
(
int
j
=
0
;
j
<
numberOfColumn
;
j
++)
{
cells
[
i
][
j
]
=
new
SquareCell
();
}
}
}
@Override
public
Cell
getCell
(
int
row
,
int
column
)
{
return
null
;
}
@Override
public
int
getNumberOfRows
()
{
return
0
;
}
@Override
public
int
getNumberOfColumns
()
{
return
0
;
}
}
This diff is collapsed.
Click to expand it.
app/src/main/java/model/SquareCell.java
+
3
−
4
View file @
27665821
...
...
@@ -7,7 +7,7 @@ import java.util.List;
public
class
SquareCell
extends
AbstractCell
{
List
<
Cell
>
neighbours
;
public
void
squareCell
()
{
Color
DEFAULT_CELL_COLOR
;
List
<
Cell
>
neighbours
;
...
...
@@ -25,15 +25,14 @@ public class SquareCell extends AbstractCell{
/**
* 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
;
}
public
List
<
Cell
>
getNeighbours
()
{
return
null
;}
/**
* Update the list of neighbours of this {@code Cell}.
...
...
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