Skip to content
Snippets Groups Projects
Commit 18c195a0 authored by Yanis OUALAN's avatar Yanis OUALAN
Browse files

Correctifs

parent e24b7f41
No related branches found
No related tags found
No related merge requests found
Pipeline #41682 passed
......@@ -38,6 +38,18 @@
mnemonicParsing="false" onAction="#pauseToggleButtonAction"
prefHeight="24.0" prefWidth="200.0"
styleClass="button" text="Pause" />
<ToggleButton fx:id="initFireFighter" maxHeight="-Infinity" maxWidth="-Infinity"
mnemonicParsing="false" onAction="#initializeFireFighter"
prefHeight="24.0" prefWidth="200.0"
styleClass="button" text="Start FireFighter" />
<ToggleButton fx:id="initVirus" maxHeight="-Infinity" maxWidth="-Infinity"
mnemonicParsing="false" onAction="#initializeDoctor"
prefHeight="24.0" prefWidth="200.0"
styleClass="button" text="Start Virus" />
<ToggleButton fx:id="initPfc" maxHeight="-Infinity" maxWidth="-Infinity"
mnemonicParsing="false" onAction="#initializePfc"
prefHeight="24.0" prefWidth="200.0"
styleClass="button" text="Start RockPaperCisor" />
</VBox>
<FirefighterGrid fx:id="grid"
xmlns="http://javafx.com/javafx"
......
......@@ -188,7 +188,7 @@ public class Controller {
entityCounts.put((pos, b) -> new model.firefighterscenario.Rockery(pos), SimulatorApplication.INITIAL_ROCKERTY_COUNT);
Model model = new model.doctorviruspatient.DoctorVirusPatientScenario(SimulatorApplication.COLUMN_COUNT, SimulatorApplication.ROW_COUNT, entityCounts);
Model model = new model.firefighterscenario.FireFighterScenario(SimulatorApplication.COLUMN_COUNT, SimulatorApplication.ROW_COUNT, entityCounts);
this.setModel(model);
repaintGrid();
}
......
......@@ -32,7 +32,7 @@ public class FireFighter implements Entity {
public FireFighter(Position position, Board<Square> b) {
this.position = position;
this.age = 0;
this.age = -2;
this.lastThreePosition = new ArrayList<Position>();
}
......
......@@ -30,11 +30,11 @@ public class FireFighterScenario extends Scenario implements Model{
Square s = iterator.next();
if (s.isEmpty())
continue;
if (s.getMaxAge() == 0) {
if (s.getMaxAge() == 0 && step > 0) {
s.incrementAllAges();
continue;
}
if (s.getMaxAge() == step + 1) {
if (s.getMaxAge() == step + 1 && step> 0) {
continue;
}
List<Entity> entities = new ArrayList<>(s.getEntities());
......
......@@ -38,6 +38,18 @@
mnemonicParsing="false" onAction="#pauseToggleButtonAction"
prefHeight="24.0" prefWidth="200.0"
styleClass="button" text="Pause" />
<ToggleButton fx:id="initFireFighter" maxHeight="-Infinity" maxWidth="-Infinity"
mnemonicParsing="false" onAction="#initializeFireFighter"
prefHeight="24.0" prefWidth="200.0"
styleClass="button" text="Start FireFighter" />
<ToggleButton fx:id="initVirus" maxHeight="-Infinity" maxWidth="-Infinity"
mnemonicParsing="false" onAction="#initializeDoctor"
prefHeight="24.0" prefWidth="200.0"
styleClass="button" text="Start Virus" />
<ToggleButton fx:id="initPfc" maxHeight="-Infinity" maxWidth="-Infinity"
mnemonicParsing="false" onAction="#initializePfc"
prefHeight="24.0" prefWidth="200.0"
styleClass="button" text="Start RockPaperCisor" />
</VBox>
<FirefighterGrid fx:id="grid"
xmlns="http://javafx.com/javafx"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment