Skip to content
Snippets Groups Projects
Commit f0040f47 authored by LATIOUI's avatar LATIOUI
Browse files

Merge remote-tracking branch 'origin/main'

parents c46592d0 31a9af37
Branches
No related tags found
No related merge requests found
Showing
with 24 additions and 25 deletions
No preview for this file type
File added
File added
File added
File added
File added
File added
No preview for this file type
package model.Builder;
public class Director {
IGameBuilder gameBuilder;
public Director(IGameBuilder gameBuilder){
this.gameBuilder=gameBuilder;
}
public void constructGame(int initialFireCount,int initialFirefighterCount,int initialCloudCount,int initialMotorizedFireFighterCount,
int initialMountainCount ,int initialRoadCount,int initialRockeryCount) {
this.gameBuilder.setFire(initialFireCount)
.setFireFighter(initialFirefighterCount)
.setRoad(initialRoadCount)
.setCloud(initialCloudCount)
.setMotorizedFireFighter(initialMotorizedFireFighterCount)
.setMountain(initialMountainCount)
.setRockery(initialRockeryCount)
.build();
}
}
package model;
import model.Builder.Director;
import model.Builder.GameBuilder;
import model.Visitor.FireFinder;
......@@ -40,16 +41,11 @@ public class GameBoard implements Board{
this.initialRockeryCount = initialRockeryCount;
}
public void initializeElements(){
GameBuilder gameBuilder=new GameBuilder();
gameBuilder.setFire(initialFireCount)
.setFireFighter(initialFirefighterCount)
.setRoad(initialRoadCount)
.setCloud(initialCloudCount)
.setMotorizedFireFighter(initialMotorizedFireFighterCount)
.setMountain(initialMountainCount)
.setRockery(initialRockeryCount)
.build();
Director director=new Director(new GameBuilder());
director.constructGame(initialFireCount,initialFirefighterCount,initialCloudCount,initialMotorizedFireFighterCount,
initialMountainCount ,initialRoadCount,initialRockeryCount);
}
public static Position randomPosition() {
......
......@@ -14,22 +14,6 @@ import java.util.List;
* @param <E> The type of elements stored in the grid.
*/
public interface Grid<E> {
/**
* Repaint the grid with a list of elements, each associated with their respective positions.
*
* @param elements A list of pairs, each containing a position and the element to be displayed at that position.
*/
// void repaint(List<Pair<Position, E>> elements);
/**
* Repaint the grid with a two-dimensional array of elements. The array's dimensions should match
* the row and column count of the grid.
*
* @param elements A two-dimensional array of elements to be displayed on the grid.
*/
// void repaint(E[][] elements);
/**
* Set the dimensions of the grid to the specified number of columns, number of rows, square width,
* and square height.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment