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 @@ ...@@ -38,6 +38,18 @@
mnemonicParsing="false" onAction="#pauseToggleButtonAction" mnemonicParsing="false" onAction="#pauseToggleButtonAction"
prefHeight="24.0" prefWidth="200.0" prefHeight="24.0" prefWidth="200.0"
styleClass="button" text="Pause" /> 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> </VBox>
<FirefighterGrid fx:id="grid" <FirefighterGrid fx:id="grid"
xmlns="http://javafx.com/javafx" xmlns="http://javafx.com/javafx"
......
...@@ -188,7 +188,7 @@ public class Controller { ...@@ -188,7 +188,7 @@ public class Controller {
entityCounts.put((pos, b) -> new model.firefighterscenario.Rockery(pos), SimulatorApplication.INITIAL_ROCKERTY_COUNT); 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); this.setModel(model);
repaintGrid(); repaintGrid();
} }
......
...@@ -32,7 +32,7 @@ public class FireFighter implements Entity { ...@@ -32,7 +32,7 @@ public class FireFighter implements Entity {
public FireFighter(Position position, Board<Square> b) { public FireFighter(Position position, Board<Square> b) {
this.position = position; this.position = position;
this.age = 0; this.age = -2;
this.lastThreePosition = new ArrayList<Position>(); this.lastThreePosition = new ArrayList<Position>();
} }
......
...@@ -30,11 +30,11 @@ public class FireFighterScenario extends Scenario implements Model{ ...@@ -30,11 +30,11 @@ public class FireFighterScenario extends Scenario implements Model{
Square s = iterator.next(); Square s = iterator.next();
if (s.isEmpty()) if (s.isEmpty())
continue; continue;
if (s.getMaxAge() == 0) { if (s.getMaxAge() == 0 && step > 0) {
s.incrementAllAges(); s.incrementAllAges();
continue; continue;
} }
if (s.getMaxAge() == step + 1) { if (s.getMaxAge() == step + 1 && step> 0) {
continue; continue;
} }
List<Entity> entities = new ArrayList<>(s.getEntities()); List<Entity> entities = new ArrayList<>(s.getEntities());
......
...@@ -38,6 +38,18 @@ ...@@ -38,6 +38,18 @@
mnemonicParsing="false" onAction="#pauseToggleButtonAction" mnemonicParsing="false" onAction="#pauseToggleButtonAction"
prefHeight="24.0" prefWidth="200.0" prefHeight="24.0" prefWidth="200.0"
styleClass="button" text="Pause" /> 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> </VBox>
<FirefighterGrid fx:id="grid" <FirefighterGrid fx:id="grid"
xmlns="http://javafx.com/javafx" 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