Skip to content
Snippets Groups Projects
Commit c230693f authored by CHERCHEM Sarah's avatar CHERCHEM Sarah
Browse files

CloudFactory : Complete the methode createElements

parent 6e37900b
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,7 @@ package model;
import util.Position;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
......@@ -15,7 +16,12 @@ public class CloudFactory implements ElementFactory<Cloud>, PositionGenerator {
}
@Override
public List<Cloud> createElements(int rowCount, int columnCount) {
return List.of();
List<Cloud> clouds = new ArrayList<>();
for (int i = 0; i < count; i++) {
Position position = generateRandomPosition(rowCount, columnCount);
clouds.add(new Cloud(position));
}
return clouds;
}
@Override
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment