Skip to content
Snippets Groups Projects
Commit e79d53a8 authored by BACHTARZI Imed eddine's avatar BACHTARZI Imed eddine
Browse files

added variable (int)counter to Fire

added Rock (and SlowFire)
modified Controller and ViewElement to only see mother class
parent 5f57314d
Branches
No related tags found
No related merge requests found
Pipeline #41016 failed
......@@ -5,22 +5,9 @@ import util.Position;
import java.util.List;
public class Mountain implements Element {
Position position;
ModelElement type;
public class Mountain extends Land implements Element {
public Mountain(Position position) {
this.position = position;
super(position);
type=ModelElement.MOUNTAIN;
}
@Override
public Position getPosition() {
return position;
}
@Override
public ModelElement getType() {
return type;
}
}
......@@ -5,5 +5,6 @@ import util.Position;
import java.util.List;
public interface RemoverBehavior<E> extends Behavior {
public void extinguish(BoardData boardData,Position position);
}
......@@ -2,22 +2,9 @@ package model;
import util.Position;
public class Road implements Element {
Position position;
ModelElement type;
public class Road extends Land implements Element {
public Road(Position position) {
this.position = position;
super(position);
type=ModelElement.ROAD;
}
@Override
public Position getPosition() {
return position;
}
@Override
public ModelElement getType() {
return type;
}
}
package model;
import util.Position;
public class Rock extends Land implements Element {
public Rock(Position position) {
super(position);
type=ModelElement.ROCK;
}
}
package model;
import util.Position;
public class SlowFire extends Fire implements Updatable{
public SlowFire(Position position) {
super(4, ModelElement.SLOWFIRE, position);
}
}
......@@ -2,7 +2,7 @@ package model;
import util.Position;
public class StandardFire extends Fire implements Updatable{
public class StandardFire extends Fire{
public StandardFire(Position position) {
super(2, ModelElement.FIRE, position);
}
......
......@@ -2,7 +2,7 @@ package model;
import util.Position;
public class StandardFireFighter extends FireFighter implements Updatable{
public class StandardFireFighter extends FireFighter{
public StandardFireFighter(Position position) {
super(1, ModelElement.FIREFIGHTER, position);
}
......
......@@ -6,5 +6,4 @@ import java.util.List;
public interface TangibleBehavior<E> extends Behavior {
public List<E> getObstacles();
public void extinguish(BoardData boardData,Position position);
}
package view;
import javafx.scene.paint.Color;
import model.*;
public enum ViewElement {
FIREFIGHTER(Color.BLUE), MOTORIZEDFIREFIGHTER(Color.DARKBLUE), FIRE(Color.RED),CLOUD(Color.GRAY) ,MOUNTAIN(Color.BROWN),ROAD(Color.BLACK), EMPTY(Color.WHITE);
FIREFIGHTER(Color.BLUE, StandardFireFighter.class), MOTORIZEDFIREFIGHTER(Color.DARKBLUE, MotorizedFireFighter.class), FIRE(Color.RED,Fire.class),CLOUD(Color.GRAY, Cloud.class) ,MOUNTAIN(Color.BROWN, Mountain.class),ROAD(Color.BLACK, Road.class),ROCK(Color.LIGHTYELLOW, Rock.class), EMPTY(Color.WHITE, null);
final Color color;
ViewElement(Color color) {
public final Class<?> c;
ViewElement(Color color, Class<?> c) {
this.color = color;
this.c = c;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment